a25db879 by 任超

style:code配置化的完成

1 parent c7c6dddb
{
"TITLE": "汉中市数据上报系统",
"THEME": "sb",
"CODE": "BDCSBPT",
"SERVERAPI": "/bdcsjsb",
"MANAGEMENTAPI": "http://192.168.2.38:8090/management"
}
\ No newline at end of file
......
/*
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-03-23 16:37:20
* @LastEditTime: 2023-03-24 16:59:29
*/
import Vue from 'vue'
import router from "./router";
......@@ -25,7 +25,7 @@ router.beforeEach(async (to, from, next) => {
localStorage.removeItem("token");
next();
} else {
let code = Vue.prototype.BASE_API.THEME == "sb" ? "BDCSBPT" : "BDCJGPT"
let code = Vue.prototype.BASE_API.CODE
//判断token是否存在
const hasToken = localStorage.getItem("token");
if (hasToken) {
......
......@@ -22,7 +22,6 @@
</div>
</template>
<script>
import { getMenuInfo } from "@/api/user";
import { loginIn } from "@/api/login.js";
export default {
name: "jgLogin",
......
......@@ -108,7 +108,7 @@ export default {
if (valid) {
let res = await loginIn(self.user.account, self.user.password)
if (res.status == 1) {
let code = this.BASE_API.THEME == "sb" ? "BDCSBPT" : "BDCJGPT"
let code = this.BASE_API.CODE;
localStorage.setItem("token", `Bearer ${res.content}`);
const { result: getMenuData } = (await getMenuInfo(code)) || [];
let path1 = JSON.parse(getMenuData[0].metadata)?.path + '/' + JSON.parse(getMenuData[0].children[0].metadata)?.path
......