|
@@ -1,4 +1,5 @@
|
|
|
import { createRouter, createWebHistory } from 'vue-router';
|
|
|
+import { store } from '@/stores/counter';
|
|
|
// 公共
|
|
|
import common from './module/common';
|
|
|
// 管理员
|
|
@@ -29,6 +30,7 @@ const router = createRouter({
|
|
|
// },
|
|
|
{
|
|
|
path: '/',
|
|
|
+ meta: { title: '基础研究动态管理平台', is_filter: true },
|
|
|
component: () => import('@common/src/components/studio-one-green/home.vue'),
|
|
|
children: [
|
|
|
{
|
|
@@ -41,4 +43,44 @@ const router = createRouter({
|
|
|
},
|
|
|
],
|
|
|
});
|
|
|
+router.beforeEach((to, from, next) => {
|
|
|
+ document.title = `${to.meta.title} `;
|
|
|
+ const token = localStorage.getItem('token');
|
|
|
+ if (token) {
|
|
|
+ // let user = jwt.decode(token);
|
|
|
+ const user = {
|
|
|
+ _id: '63b511fa2f41cd4838e478bb',
|
|
|
+ account: 'sunit',
|
|
|
+ card: '220182199603257020',
|
|
|
+ name: '公司负责人',
|
|
|
+ nick_name: '长春市福瑞科技有限公司',
|
|
|
+ email: '1946230922@qq.com',
|
|
|
+ phone: '13174420325',
|
|
|
+ unit_name: '长春市福瑞科技有限公司',
|
|
|
+ unit_address: '长春市朝阳区前进大街1244号',
|
|
|
+ prove: [
|
|
|
+ {
|
|
|
+ id: '20230104134319',
|
|
|
+ name: 'free.png',
|
|
|
+ uri: '/files/jcyjdt/register/20230104134319.png',
|
|
|
+ url: 'http://broadcast.waityou24.cn/files/jcyjdt/register/20230104134319.png',
|
|
|
+ uid: 1672810999458,
|
|
|
+ status: 'success',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ role: ['63b628619bb09c9905df137b', '63b64a9435df6c6862e0c882', '63b64b4435df6c6862e12d84', '63b62cf19bb09c9905e17543'],
|
|
|
+ exam_status: '1',
|
|
|
+ is_studio: 'Y',
|
|
|
+ role_type: '3',
|
|
|
+ iat: 1679033671,
|
|
|
+ exp: 1679206471,
|
|
|
+ };
|
|
|
+ console.log(store);
|
|
|
+
|
|
|
+ // store.commit('setUser', user, { root: true });
|
|
|
+ next();
|
|
|
+ } else {
|
|
|
+ window.alert('无登录信息,无法打开');
|
|
|
+ }
|
|
|
+});
|
|
|
export default router;
|