fix
Showing
4 changed files
with
9 additions
and
6 deletions
| ... | @@ -6,6 +6,8 @@ VITE_APP_TITLE = 数据资产管理系统 | ... | @@ -6,6 +6,8 @@ VITE_APP_TITLE = 数据资产管理系统 |
| 6 | # VITE_API_BASEURL = http://localhost:9000 | 6 | # VITE_API_BASEURL = http://localhost:9000 |
| 7 | VITE_API_BASEURL = http://192.168.6.20:28052/ | 7 | VITE_API_BASEURL = http://192.168.6.20:28052/ |
| 8 | 8 | ||
| 9 | VITE_IDASS_BASEURL = https://idaas-test.csbr.cn/login | ||
| 10 | |||
| 9 | # 平台用户 接口请地址 | 11 | # 平台用户 接口请地址 |
| 10 | VITE_APP_USER_API_BASEURL = gateway-server | 12 | VITE_APP_USER_API_BASEURL = gateway-server |
| 11 | 13 | ... | ... |
| ... | @@ -4,6 +4,8 @@ VITE_APP_TITLE = 数据资产管理系统 | ... | @@ -4,6 +4,8 @@ VITE_APP_TITLE = 数据资产管理系统 |
| 4 | VITE_API_BASEURL = http://192.168.6.20:28052/ | 4 | VITE_API_BASEURL = http://192.168.6.20:28052/ |
| 5 | # VITE_API_BASEURL = http://49.4.26.201:31709/ | 5 | # VITE_API_BASEURL = http://49.4.26.201:31709/ |
| 6 | 6 | ||
| 7 | VITE_IDASS_BASEURL = https://idaas-test.csbr.cn/login | ||
| 8 | |||
| 7 | # # 平台用户 接口请地址 | 9 | # # 平台用户 接口请地址 |
| 8 | # VITE_APP_USER_API_BASEURL = gateway-server | 10 | # VITE_APP_USER_API_BASEURL = gateway-server |
| 9 | 11 | ... | ... |
| ... | @@ -42,7 +42,7 @@ router.beforeEach(async (to, from, next) => { | ... | @@ -42,7 +42,7 @@ router.beforeEach(async (to, from, next) => { |
| 42 | // name: 'login', | 42 | // name: 'login', |
| 43 | // replace: true, | 43 | // replace: true, |
| 44 | // }) | 44 | // }) |
| 45 | window.location.href = userStore.idassLoginUrl; | 45 | window.location.href = import.meta.env.VITE_IDASS_BASEURL; |
| 46 | } | 46 | } |
| 47 | else if (to.name == 'scenes') { | 47 | else if (to.name == 'scenes') { |
| 48 | next({ | 48 | next({ |
| ... | @@ -131,7 +131,7 @@ router.beforeEach(async (to, from, next) => { | ... | @@ -131,7 +131,7 @@ router.beforeEach(async (to, from, next) => { |
| 131 | next() | 131 | next() |
| 132 | } | 132 | } |
| 133 | else if (!to.query.code && to.name !== 'login') { | 133 | else if (!to.query.code && to.name !== 'login') { |
| 134 | window.location.href = userStore.idassLoginUrl; | 134 | window.location.href = import.meta.env.VITE_IDASS_BASEURL; |
| 135 | // next({ | 135 | // next({ |
| 136 | // name: 'login', | 136 | // name: 'login', |
| 137 | // query: { | 137 | // query: { | ... | ... |
| ... | @@ -27,7 +27,7 @@ const useUserStore = defineStore( | ... | @@ -27,7 +27,7 @@ const useUserStore = defineStore( |
| 27 | const isLogin = ref(token.value ? true : false);//退出登录。 | 27 | const isLogin = ref(token.value ? true : false);//退出登录。 |
| 28 | const getTokenPromise: any = ref(null); | 28 | const getTokenPromise: any = ref(null); |
| 29 | /* idass的登录页面url,退出登录需要跳转到登录页。*/ | 29 | /* idass的登录页面url,退出登录需要跳转到登录页。*/ |
| 30 | const idassLoginUrl = ref('https://idaas-test.csbr.cn/login'); | 30 | const idassLoginUrl = import.meta.env.VITE_IDASS_BASEURL; |
| 31 | const timer: any = ref(null); | 31 | const timer: any = ref(null); |
| 32 | //获取token. | 32 | //获取token. |
| 33 | function getToken(data, state) { | 33 | function getToken(data, state) { |
| ... | @@ -175,7 +175,7 @@ const useUserStore = defineStore( | ... | @@ -175,7 +175,7 @@ const useUserStore = defineStore( |
| 175 | menuStore.setActived(0) | 175 | menuStore.setActived(0) |
| 176 | tabbar.value = [] | 176 | tabbar.value = [] |
| 177 | tabbarMap.value = {} | 177 | tabbarMap.value = {} |
| 178 | window.location.href = idassLoginUrl.value + '?logout=1'; | 178 | window.location.href = idassLoginUrl + '?logout=1'; |
| 179 | }); | 179 | }); |
| 180 | } else { | 180 | } else { |
| 181 | let hasCode = localStorage.getItem('code'); | 181 | let hasCode = localStorage.getItem('code'); |
| ... | @@ -194,7 +194,7 @@ const useUserStore = defineStore( | ... | @@ -194,7 +194,7 @@ const useUserStore = defineStore( |
| 194 | tabbar.value = [] | 194 | tabbar.value = [] |
| 195 | tabbarMap.value = {} | 195 | tabbarMap.value = {} |
| 196 | if (hasCode) { | 196 | if (hasCode) { |
| 197 | window.location.href = idassLoginUrl.value + '?logout=1'; | 197 | window.location.href = idassLoginUrl + '?logout=1'; |
| 198 | } else { | 198 | } else { |
| 199 | router.push({ | 199 | router.push({ |
| 200 | name: 'login', | 200 | name: 'login', |
| ... | @@ -312,7 +312,6 @@ const useUserStore = defineStore( | ... | @@ -312,7 +312,6 @@ const useUserStore = defineStore( |
| 312 | permissions, | 312 | permissions, |
| 313 | isLogin, | 313 | isLogin, |
| 314 | isLoginOut, | 314 | isLoginOut, |
| 315 | idassLoginUrl, | ||
| 316 | getTokenPromise, | 315 | getTokenPromise, |
| 317 | getToken, | 316 | getToken, |
| 318 | login, | 317 | login, | ... | ... |
-
Please register or sign in to post a comment