style:code配置化的完成
Showing
6 changed files
with
4 additions
and
4 deletions
1 | { | 1 | { |
2 | "TITLE": "汉中市数据上报系统", | 2 | "TITLE": "汉中市数据上报系统", |
3 | "THEME": "sb", | 3 | "THEME": "sb", |
4 | "CODE": "BDCSBPT", | ||
4 | "SERVERAPI": "/bdcsjsb", | 5 | "SERVERAPI": "/bdcsjsb", |
5 | "MANAGEMENTAPI": "http://192.168.2.38:8090/management" | 6 | "MANAGEMENTAPI": "http://192.168.2.38:8090/management" |
6 | } | 7 | } |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
1 | /* | 1 | /* |
2 | * @Description: | 2 | * @Description: |
3 | * @Autor: renchao | 3 | * @Autor: renchao |
4 | * @LastEditTime: 2023-03-23 16:37:20 | 4 | * @LastEditTime: 2023-03-24 16:59:29 |
5 | */ | 5 | */ |
6 | import Vue from 'vue' | 6 | import Vue from 'vue' |
7 | import router from "./router"; | 7 | import router from "./router"; |
... | @@ -25,7 +25,7 @@ router.beforeEach(async (to, from, next) => { | ... | @@ -25,7 +25,7 @@ router.beforeEach(async (to, from, next) => { |
25 | localStorage.removeItem("token"); | 25 | localStorage.removeItem("token"); |
26 | next(); | 26 | next(); |
27 | } else { | 27 | } else { |
28 | let code = Vue.prototype.BASE_API.THEME == "sb" ? "BDCSBPT" : "BDCJGPT" | 28 | let code = Vue.prototype.BASE_API.CODE |
29 | //判断token是否存在 | 29 | //判断token是否存在 |
30 | const hasToken = localStorage.getItem("token"); | 30 | const hasToken = localStorage.getItem("token"); |
31 | if (hasToken) { | 31 | if (hasToken) { | ... | ... |
... | @@ -22,7 +22,6 @@ | ... | @@ -22,7 +22,6 @@ |
22 | </div> | 22 | </div> |
23 | </template> | 23 | </template> |
24 | <script> | 24 | <script> |
25 | import { getMenuInfo } from "@/api/user"; | ||
26 | import { loginIn } from "@/api/login.js"; | 25 | import { loginIn } from "@/api/login.js"; |
27 | export default { | 26 | export default { |
28 | name: "jgLogin", | 27 | name: "jgLogin", | ... | ... |
... | @@ -108,7 +108,7 @@ export default { | ... | @@ -108,7 +108,7 @@ export default { |
108 | if (valid) { | 108 | if (valid) { |
109 | let res = await loginIn(self.user.account, self.user.password) | 109 | let res = await loginIn(self.user.account, self.user.password) |
110 | if (res.status == 1) { | 110 | if (res.status == 1) { |
111 | let code = this.BASE_API.THEME == "sb" ? "BDCSBPT" : "BDCJGPT" | 111 | let code = this.BASE_API.CODE; |
112 | localStorage.setItem("token", `Bearer ${res.content}`); | 112 | localStorage.setItem("token", `Bearer ${res.content}`); |
113 | const { result: getMenuData } = (await getMenuInfo(code)) || []; | 113 | const { result: getMenuData } = (await getMenuInfo(code)) || []; |
114 | let path1 = JSON.parse(getMenuData[0].metadata)?.path + '/' + JSON.parse(getMenuData[0].children[0].metadata)?.path | 114 | let path1 = JSON.parse(getMenuData[0].metadata)?.path + '/' + JSON.parse(getMenuData[0].children[0].metadata)?.path | ... | ... |
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
-
Please register or sign in to post a comment