|
|
@ -105,13 +105,20 @@ import { getUUID } from '@/utils' |
|
|
}) |
|
|
}) |
|
|
}).then(({data}) => { |
|
|
}).then(({data}) => { |
|
|
if (data && data.code === 0) { |
|
|
if (data && data.code === 0) { |
|
|
// console.log('跳转前路径:', localStorage.getItem('redirectPath')); // 检查路径是否正确 |
|
|
|
|
|
|
|
|
console.log('跳转前路径:', localStorage.getItem('redirectPath')); // 检查路径是否正确 |
|
|
this.$cookie.set('token', data.token) |
|
|
this.$cookie.set('token', data.token) |
|
|
// 动态跳转逻辑 |
|
|
// 动态跳转逻辑 |
|
|
// const redirectPath = localStorage.getItem('redirectPath') || '/home'; |
|
|
|
|
|
// console.log('Redirecting to:', redirectPath); // 调试输出 |
|
|
|
|
|
// this.$router.replace(redirectPath); // 根据保存的路径跳转 |
|
|
|
|
|
this.$router.replace({name: 'home'}) |
|
|
|
|
|
|
|
|
const redirectPath = localStorage.getItem('redirectPath') || ''; |
|
|
|
|
|
|
|
|
|
|
|
// 设置需要判断的路径 |
|
|
|
|
|
const pathsToRedirect = ['/auth-authQuote', '/auth-authInquiry']; |
|
|
|
|
|
|
|
|
|
|
|
if (pathsToRedirect.some(path => redirectPath.indexOf(path) !== -1)) { |
|
|
|
|
|
this.$router.replace(redirectPath); |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$router.replace({ name: 'home' }); |
|
|
|
|
|
} |
|
|
|
|
|
console.log('Redirecting to:', redirectPath); // 调试输出 |
|
|
this.$i18n.locale=data.language |
|
|
this.$i18n.locale=data.language |
|
|
localStorage.setItem('locale', data.language) |
|
|
localStorage.setItem('locale', data.language) |
|
|
localStorage.setItem('refresh', "0") |
|
|
localStorage.setItem('refresh', "0") |
|
|
|