fix: BUG修改
This commit is contained in:
parent
67c3cec8f4
commit
c9d6446308
@ -3,7 +3,7 @@ NODE_ENV = 'development'
|
||||
|
||||
# 本地环境接口地址(/api/index.ts文件中使用)
|
||||
# 后端本地
|
||||
# VITE_API_URL = 'http://192.168.34.221:9111'
|
||||
VITE_API_URL = 'http://192.168.34.221:9111'
|
||||
# VITE_API_URL = 'http://192.168.34.221:28888'
|
||||
# VITE_API_URL = 'http://121.196.214.246/api'
|
||||
# VITE_API_URL = 'http://jxj.zhgdyun.com:100'
|
||||
@ -21,7 +21,7 @@ NODE_ENV = 'development'
|
||||
# 七参数标准版(测试平台)
|
||||
# VITE_API_URL = 'http://182.90.224.237:15551'
|
||||
# agjt
|
||||
VITE_API_URL = 'http://47.93.215.234:9809'
|
||||
# VITE_API_URL = 'http://47.93.215.234:9809'
|
||||
# 上传
|
||||
VITE_ULD_API_URL = 'http://192.168.34.155:8012/onlinePreview?url='
|
||||
|
||||
|
||||
@ -37,11 +37,24 @@ const router = createRouter({
|
||||
router.beforeEach(async (to, from, next) => {
|
||||
const globalStore = GlobalStore();
|
||||
// 解决首次跳转失败
|
||||
let freeToken = window.location.href.indexOf("token") != -1;
|
||||
if (freeToken) {
|
||||
globalStore.token = window.location.href.split("token=")[1];
|
||||
// let freeToken = window.location.href.indexOf("token") != -1;
|
||||
// let freeSn = window.location.href.indexOf("sn") != -1;
|
||||
// if (freeToken) {
|
||||
// globalStore.token = window.location.href.split("token=")[1];
|
||||
// }
|
||||
let urlParams = new URLSearchParams(window.location.href.split('?')[1]);
|
||||
let params = {} as any;
|
||||
urlParams.forEach((value, key) => {
|
||||
params[key] = value;
|
||||
});
|
||||
console.log(params,'我的测试11111')
|
||||
if(params.token){
|
||||
globalStore.token = params.token;
|
||||
}
|
||||
if(params.sn){
|
||||
globalStore.setSN(params.sn);
|
||||
}
|
||||
console.log("免登录", freeToken, globalStore.token);
|
||||
// console.log("免登录", freeToken, globalStore.token);
|
||||
// 1.NProgress 开始
|
||||
NProgress.start();
|
||||
|
||||
|
||||
@ -457,7 +457,9 @@ onMounted(async () => {
|
||||
const newToken = window.location.href.split("token=")[1];
|
||||
const data: any = await jumpLargeUserInfoApi({ token: newToken });
|
||||
console.log("跳转请求的数据----", data.result);
|
||||
store.setSN(data.result.sn);
|
||||
if(data.result.sn){
|
||||
store.setSN(data.result.sn);
|
||||
}
|
||||
store.setToken(data.result.token);
|
||||
store.setAccount(data.result.account);
|
||||
store.setAccountType(data.result.accountType);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user