diff --git a/index.html b/index.html index c22fdc3..88dde02 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ - aigc + 海兔AIGC
diff --git a/src/components/auth/Login.vue b/src/components/auth/Login.vue index 8c8f256..af7608f 100644 --- a/src/components/auth/Login.vue +++ b/src/components/auth/Login.vue @@ -158,7 +158,7 @@ const reRenderEmailGetcodebtn = () => { } const validate = () => { - if (loginType == 'tel') { + if (loginType.value == 'tel') { if (!telReg.test(tel.value)) { showToast('请输入正确的手机号码!'); return false; @@ -168,7 +168,7 @@ const validate = () => { return false; } } - if (loginType == 'email') { + if (loginType.value == 'email') { if (!emailReg.test(email.value)) { showToast('请输入正确的邮箱地址!'); return false; diff --git a/src/io/httpConfig.js b/src/io/httpConfig.js index 4a144c3..7876eed 100755 --- a/src/io/httpConfig.js +++ b/src/io/httpConfig.js @@ -9,6 +9,7 @@ import { localCache } from './cache'; import router from "@/router"; import { showToast } from 'vant'; import { useAuthModal } from '@/stores/authModal'; +import { useUserInfo } from '@/stores/userInfo'; import hostAPI from '@/config/host.config' export default function () { @@ -16,6 +17,7 @@ export default function () { let requestCount = 0;//请求数量 const authModal = useAuthModal(); + const userInfo = useUserInfo(); const showLoading = ()=>{ if (requestCount === 0) { @@ -77,6 +79,7 @@ export default function () { showToast('账号过期或异地登录, 请重新登录'); localCache.remove('auth'); localCache.remove('userInfo'); + userInfo.updateUserInfo({}); authModal.setAuthModalType('login'); authModal.showAuthModal(); // router.replace({name: 'Home', params: {auth: 'over'}}); @@ -97,6 +100,7 @@ export default function () { showToast('账号过期或异地登录, 请重新登录'); localCache.remove('auth'); localCache.remove('userInfo'); + userInfo.updateUserInfo({}); authModal.setAuthModalType('login'); authModal.showAuthModal(); break; diff --git a/src/io/request.js b/src/io/request.js index 82d936b..d6f4d1e 100644 --- a/src/io/request.js +++ b/src/io/request.js @@ -4,7 +4,7 @@ import { localCache } from '@/io/cache' import { showToast } from 'vant' import { useAuthModal } from '@/stores/authModal'; - +import { useUserInfo } from '@/stores/userInfo'; const service = axios.create({ @@ -38,6 +38,7 @@ service.interceptors.response.use( const { requestBaseUrl } = response.config const res = response.data const authModal = useAuthModal(); + const userInfo = useUserInfo(); if (requestBaseUrl == 'chat') { return res } else { @@ -45,6 +46,7 @@ service.interceptors.response.use( if (res.status == 401) { authModal.setAuthModalType('login'); authModal.showAuthModal(); + userInfo.updateUserInfo({}); localCache.remove('auth'); localCache.remove('userInfo'); } else { @@ -58,6 +60,7 @@ service.interceptors.response.use( }, error => { const authModal = useAuthModal(); + const userInfo = useUserInfo(); if (error.message == 'canceled') return Promise.reject(error) const res = error.response?.data @@ -67,6 +70,7 @@ service.interceptors.response.use( if (res.errcode == 401) { authModal.setAuthModalType('login'); authModal.showAuthModal(); + userInfo.updateUserInfo({}); localCache.remove('auth'); localCache.remove('userInfo'); } else { diff --git a/src/router/index.js b/src/router/index.js index 9294b63..558904a 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -185,15 +185,17 @@ const router = createRouter({ path: "training", name: "Training", meta: { - title: "AI培训", + title: "AI培训", + group: 'training' }, - component: () => import("@/views/training/index.vue"), + component: () => import("@/views/training/home.vue"), }, { path: "vip", name: "Vip", meta: { title: "会员专区", + group: 'vip' }, component: () => import("@/views/vip/index.vue"), }, diff --git a/src/views/business/home.vue b/src/views/business/home.vue index b0ba3d2..44b45a9 100644 --- a/src/views/business/home.vue +++ b/src/views/business/home.vue @@ -1,5 +1,5 @@