feat: 解决登录页授权 IP 跳转失败的问题 (#4517)

This commit is contained in:
ssongliu 2024-04-15 15:10:10 +08:00 committed by GitHub
parent fbd0e836d7
commit a3312331d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 16 additions and 5 deletions

View File

@ -100,6 +100,10 @@ const resetSetting = () => {
const loadProductProFromDB = async () => { const loadProductProFromDB = async () => {
const res = await getLicense(); const res = await getLicense();
if (!res.data) {
globalStore.isProductPro = false;
return;
}
globalStore.isProductPro = globalStore.isProductPro =
res.data.status === 'Enable' || res.data.status === 'Lost01' || res.data.status === 'Lost02'; res.data.status === 'Enable' || res.data.status === 'Lost01' || res.data.status === 'Lost02';

View File

@ -13,7 +13,7 @@ router.beforeEach((to, from, next) => {
if (to.name !== 'entrance' && !globalStore.isLogin) { if (to.name !== 'entrance' && !globalStore.isLogin) {
next({ next({
name: 'entrance', name: 'entrance',
params: to.params, params: { code: to.params?.code || globalStore.entrance },
}); });
NProgress.done(); NProgress.done();
return; return;

View File

@ -60,7 +60,6 @@ const loading = ref();
const mySafetyCode = defineProps({ const mySafetyCode = defineProps({
code: { code: {
type: String, type: String,
required: true,
default: '', default: '',
}, },
}); });
@ -94,10 +93,18 @@ const getStatus = async () => {
errStatus.value = ''; errStatus.value = '';
loading.value = false; loading.value = false;
}) })
.catch(() => { .catch((errRes) => {
pageCode.value = '200'; pageCode.value = pageCode.value || '200';
errStatus.value = 'err-unsafe';
loading.value = false; loading.value = false;
if (errRes?.code === 408) {
errStatus.value = 'err-ip';
return;
}
if (errRes?.code === 409) {
errStatus.value = 'err-domain';
return;
}
errStatus.value = 'err-unsafe';
}); });
}) })
.catch(() => { .catch(() => {