diff --git a/public/config/config.json b/public/config/config.json index 12a6978..27d5341 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,6 +1,6 @@ { "title": "安全生产智慧监管系统", - "baseUrl": "http://192.168.83.42:6909/safe-server/", + "baseUrl": "http://192.168.83.37:6909/safe-server/", "mediaBaseUrl": "http://192.168.83.42:80", "lat-bd": "39.91459528", "lng-bd": "116.26499505", diff --git a/public/config/config.json b/public/config/config.json index 12a6978..27d5341 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,6 +1,6 @@ { "title": "安全生产智慧监管系统", - "baseUrl": "http://192.168.83.42:6909/safe-server/", + "baseUrl": "http://192.168.83.37:6909/safe-server/", "mediaBaseUrl": "http://192.168.83.42:80", "lat-bd": "39.91459528", "lng-bd": "116.26499505", diff --git a/src/api/index.ts b/src/api/index.ts index 244333e..4f5ac4e 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -43,7 +43,12 @@ */ if (userStore.isLogin && request.headers) { request.headers.token = userStore.token + // request.headers.token = localStorage.getItem('token') } + if (!userStore.isLogin && localStorage.getItem('tokenBak') === 'true') { // 未登录且url带token + request.headers.token = localStorage.getItem('token') + } + // 是否将 POST 请求参数进行字符串化处理 if (request.method === 'post') { // request.data = qs.stringify(request.data, { @@ -78,6 +83,7 @@ }) } else { + console.log('跳转到404以外其他页面') // token失效状态跳转到登录页 toLogin() if (useUserStore().isLogout === 0) { diff --git a/public/config/config.json b/public/config/config.json index 12a6978..27d5341 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,6 +1,6 @@ { "title": "安全生产智慧监管系统", - "baseUrl": "http://192.168.83.42:6909/safe-server/", + "baseUrl": "http://192.168.83.37:6909/safe-server/", "mediaBaseUrl": "http://192.168.83.42:80", "lat-bd": "39.91459528", "lng-bd": "116.26499505", diff --git a/src/api/index.ts b/src/api/index.ts index 244333e..4f5ac4e 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -43,7 +43,12 @@ */ if (userStore.isLogin && request.headers) { request.headers.token = userStore.token + // request.headers.token = localStorage.getItem('token') } + if (!userStore.isLogin && localStorage.getItem('tokenBak') === 'true') { // 未登录且url带token + request.headers.token = localStorage.getItem('token') + } + // 是否将 POST 请求参数进行字符串化处理 if (request.method === 'post') { // request.data = qs.stringify(request.data, { @@ -78,6 +83,7 @@ }) } else { + console.log('跳转到404以外其他页面') // token失效状态跳转到登录页 toLogin() if (useUserStore().isLogout === 0) { diff --git a/src/api/indexMedia.ts b/src/api/indexMedia.ts index 72d60b2..9304b62 100644 --- a/src/api/indexMedia.ts +++ b/src/api/indexMedia.ts @@ -45,6 +45,10 @@ */ if (userStore.isLogin && request.headers) { request.headers.token = userStore.token + // request.headers.token = localStorage.getItem('token') + } + if (!userStore.isLogin && localStorage.getItem('tokenBak') === 'true') { // 未登录且url带token + request.headers.token = localStorage.getItem('token') } // 是否将 POST 请求参数进行字符串化处理 if (request.method === 'post') { diff --git a/public/config/config.json b/public/config/config.json index 12a6978..27d5341 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,6 +1,6 @@ { "title": "安全生产智慧监管系统", - "baseUrl": "http://192.168.83.42:6909/safe-server/", + "baseUrl": "http://192.168.83.37:6909/safe-server/", "mediaBaseUrl": "http://192.168.83.42:80", "lat-bd": "39.91459528", "lng-bd": "116.26499505", diff --git a/src/api/index.ts b/src/api/index.ts index 244333e..4f5ac4e 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -43,7 +43,12 @@ */ if (userStore.isLogin && request.headers) { request.headers.token = userStore.token + // request.headers.token = localStorage.getItem('token') } + if (!userStore.isLogin && localStorage.getItem('tokenBak') === 'true') { // 未登录且url带token + request.headers.token = localStorage.getItem('token') + } + // 是否将 POST 请求参数进行字符串化处理 if (request.method === 'post') { // request.data = qs.stringify(request.data, { @@ -78,6 +83,7 @@ }) } else { + console.log('跳转到404以外其他页面') // token失效状态跳转到登录页 toLogin() if (useUserStore().isLogout === 0) { diff --git a/src/api/indexMedia.ts b/src/api/indexMedia.ts index 72d60b2..9304b62 100644 --- a/src/api/indexMedia.ts +++ b/src/api/indexMedia.ts @@ -45,6 +45,10 @@ */ if (userStore.isLogin && request.headers) { request.headers.token = userStore.token + // request.headers.token = localStorage.getItem('token') + } + if (!userStore.isLogin && localStorage.getItem('tokenBak') === 'true') { // 未登录且url带token + request.headers.token = localStorage.getItem('token') } // 是否将 POST 请求参数进行字符串化处理 if (request.method === 'post') { diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue index 7222afd..d6fc326 100644 --- a/src/layouts/components/Tools/index.vue +++ b/src/layouts/components/Tools/index.vue @@ -77,9 +77,11 @@ function pro() { window.open('https://hooray.gitee.io/fantastic-admin-pro-example/', 'top') } +const systemType = ref('') onMounted(() => { // 连接 websocket // websocket.initWebSocket() + systemType.value = window.localStorage.getItem('systemType') as string }) onBeforeMount(() => { // 断开 websocket @@ -161,7 +163,13 @@ --> - +
+ {{ userStore.name }} + + + +
+
- +
+ {{ userStore.name }} + + + +
+
- +
+ {{ userStore.name }} + + + +
+
- +
+ {{ userStore.name }} + + + +
+
- +
+ {{ userStore.name }} + + + +
+
- +
+ {{ userStore.name }} + + + +
+
- +
+ {{ userStore.name }} + + + +
+
- +
+ {{ userStore.name }} + + + +
+
- +
+ {{ userStore.name }} + + + +
+
- +
+ {{ userStore.name }} + + + +
+
- +
+ {{ userStore.name }} + + + +
+
- +
+ {{ userStore.name }} + + + +
+
- +
+ {{ userStore.name }} + + + +
+