diff --git a/root/api/user.js b/root/api/user.js index 09fadbd..bad7994 100644 --- a/root/api/user.js +++ b/root/api/user.js @@ -1,7 +1,7 @@ //import red from '../res/js/red' const login = ({username, pwd}) => { - return red.postX("/user/login", {username, pwd, plattoken: 'xx'}) + return red.postX("/user/login", {username, pwd, plattoken: ''}) } const logout = () => { diff --git a/root/index.html b/root/index.html index e21f948..ba31ac9 100644 --- a/root/index.html +++ b/root/index.html @@ -75,15 +75,20 @@ 绝尘 -->
+ +
+ +
- diff --git a/root/metadata/dataList.html b/root/metadata/dataList.html index 30d79a0..c430159 100644 --- a/root/metadata/dataList.html +++ b/root/metadata/dataList.html @@ -86,16 +86,17 @@
- {{filter.label}} + {{filter.label}} @@ -298,7 +299,8 @@ } }) }, - service() { + service(v) { + red.setData("meta:service", v) this.loadCfg(function () { vm.limit = {pn: 1, ps: 20, total: 0}; vm.findList(); @@ -326,9 +328,20 @@ return; }, serviceList() { - getServiceList(json => { - vm.services = json; - vm.service = json[0].name; + getServiceList(res => { + vm.services = res; + + // 如果有缓存数据,优先取上一次访问页面 + if (red.getData("meta:service")) { + for (let i in res) { + if (res[i].name === red.getData("meta:service")) { + vm.service = res[i].name; + break + } + } + } else { + vm.service = res[0].name; + } }); }, loadCfg(back) { @@ -536,7 +549,11 @@ }, showInfo() { $('#f-info').modal({moveable: true}) - } + }, + getDict(code) { + console.log(this.dictData[code]) + return this.dictData[code] || [] + }, }, mounted() { this.serviceList(); diff --git a/root/metadata/metaService.html b/root/metadata/metaService.html index ab9d485..aebdb0f 100644 --- a/root/metadata/metaService.html +++ b/root/metadata/metaService.html @@ -365,8 +365,11 @@ - + +