fix: BUG修改

This commit is contained in:
kun 2024-04-16 23:17:46 +08:00
parent 67c3cec8f4
commit c9d6446308
3 changed files with 22 additions and 7 deletions

View File

@ -3,7 +3,7 @@ NODE_ENV = 'development'
# 本地环境接口地址(/api/index.ts文件中使用) # 本地环境接口地址(/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://192.168.34.221:28888'
# VITE_API_URL = 'http://121.196.214.246/api' # VITE_API_URL = 'http://121.196.214.246/api'
# VITE_API_URL = 'http://jxj.zhgdyun.com:100' # VITE_API_URL = 'http://jxj.zhgdyun.com:100'
@ -21,7 +21,7 @@ NODE_ENV = 'development'
# 七参数标准版(测试平台) # 七参数标准版(测试平台)
# VITE_API_URL = 'http://182.90.224.237:15551' # VITE_API_URL = 'http://182.90.224.237:15551'
# agjt # 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=' VITE_ULD_API_URL = 'http://192.168.34.155:8012/onlinePreview?url='

View File

@ -37,11 +37,24 @@ const router = createRouter({
router.beforeEach(async (to, from, next) => { router.beforeEach(async (to, from, next) => {
const globalStore = GlobalStore(); const globalStore = GlobalStore();
// 解决首次跳转失败 // 解决首次跳转失败
let freeToken = window.location.href.indexOf("token") != -1; // let freeToken = window.location.href.indexOf("token") != -1;
if (freeToken) { // let freeSn = window.location.href.indexOf("sn") != -1;
globalStore.token = window.location.href.split("token=")[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 开始 // 1.NProgress 开始
NProgress.start(); NProgress.start();

View File

@ -457,7 +457,9 @@ onMounted(async () => {
const newToken = window.location.href.split("token=")[1]; const newToken = window.location.href.split("token=")[1];
const data: any = await jumpLargeUserInfoApi({ token: newToken }); const data: any = await jumpLargeUserInfoApi({ token: newToken });
console.log("跳转请求的数据----", data.result); console.log("跳转请求的数据----", data.result);
store.setSN(data.result.sn); if(data.result.sn){
store.setSN(data.result.sn);
}
store.setToken(data.result.token); store.setToken(data.result.token);
store.setAccount(data.result.account); store.setAccount(data.result.account);
store.setAccountType(data.result.accountType); store.setAccountType(data.result.accountType);