diff --git a/front/src/router/index.js b/front/src/router/index.js index 47c429c7..9c0f4ca9 100644 --- a/front/src/router/index.js +++ b/front/src/router/index.js @@ -1,5 +1,7 @@ import { createRouter, createWebHashHistory } from 'vue-router' import Layout from '@/layout' +import { message } from 'ant-design-vue' +import Cookies from 'js-cookie' export const constantRoutes = [ { @@ -567,4 +569,24 @@ const router = createRouter({ routes: constantRoutes, }) +router.beforeEach((to, from, next) => { + let token = Cookies.get('ucsToken') + const tokenStartTime = window.localStorage.getItem('tokenStartTime') + // 定义失效时间 + const timeOver = 2 * 60 * 60 * 1000 + let date = new Date().getTime() + if (date - tokenStartTime > timeOver) { + token = null + } + console.log('判断token失效', token, date - tokenStartTime > timeOver) + if (!token) { + if (to.path == '/login') return next() + message.warning('登录失效,请重新登录!') + return next('/login') + } else if (to.path == '/login') { + return next('/home') + } + next() +}) + export default router diff --git a/front/src/views/home/AbilityToApplyFor.vue b/front/src/views/home/AbilityToApplyFor.vue index 84cf6400..9eb8fd49 100644 --- a/front/src/views/home/AbilityToApplyFor.vue +++ b/front/src/views/home/AbilityToApplyFor.vue @@ -152,7 +152,7 @@ ]) // eslint-disable-next-line vue/no-setup-props-destructure dataForm.value = props.dataList - console.log('=========================>', dataForm.value) + console.log('============dataList=============>', dataForm.value) // const router = useRouter() // const arr = // router.currentRoute.value.query.name instanceof Array @@ -181,7 +181,7 @@ let arr = JSON.parse(note1) xVideoList.value = [] arr.map((val) => { - xVideoList.value.push({ name: val.channelName, key: val.channelId }) + xVideoList.value.push({ name: val.channelName || '', key: val.channelId }) }) videoVisible.value = true } else { diff --git a/front/src/views/home/apply.vue b/front/src/views/home/apply.vue index 59c1b3a7..f49180d0 100644 --- a/front/src/views/home/apply.vue +++ b/front/src/views/home/apply.vue @@ -51,7 +51,7 @@ style="width: 230px" :options="systemOptions" @focus="handleFocus" @blur="handleBlur" @change="systemHandleChange" @search="systemHandleSearch"> - 请输入关键字(如选项没有系统请新增) + 如选项没有系统请新增 diff --git a/front/src/views/instructionManual/index.vue b/front/src/views/instructionManual/index.vue index 55c9bb3d..9e09a015 100644 --- a/front/src/views/instructionManual/index.vue +++ b/front/src/views/instructionManual/index.vue @@ -12,7 +12,7 @@ -->
+ @click="downloadDoc('/static/doc/userbook.docx', '通用能力服务平台USC用户手册')">
使用手册
diff --git a/front/src/views/login/index.vue b/front/src/views/login/index.vue index cd9cc7f8..c684ab11 100644 --- a/front/src/views/login/index.vue +++ b/front/src/views/login/index.vue @@ -15,7 +15,11 @@
- + @@ -23,8 +27,15 @@ - + 登录 @@ -36,191 +47,196 @@ diff --git a/front/src/views/personalCenter/components/MyApply.vue b/front/src/views/personalCenter/components/MyApply.vue index 1c11bafe..4e1b1353 100644 --- a/front/src/views/personalCenter/components/MyApply.vue +++ b/front/src/views/personalCenter/components/MyApply.vue @@ -148,7 +148,7 @@ let typeList = ref([ '能力下架', '能力需求', '需求评论', - '能力评价', + // '能力评价', ]) // 西海岸-设备申请 let isXiHaiAn = whoShow.itShowXiHaiAn