gjy 2 年 前
コミット
7aec48dae2
3 ファイル変更10 行追加3 行削除
  1. 5 0
      src/permission.js
  2. 2 0
      src/router/index.js
  3. 3 3
      src/views/profitable/receipt.vue

+ 5 - 0
src/permission.js

@@ -18,14 +18,18 @@ router.beforeEach(async (to, _, next) => {
 
   // 用户刷新页面,localStorage还在,但vuex.store里的东西会reset
   const hasToken = getToken();
+  console.log(hasToken)
   if (hasToken) {
     if (whiteList.includes(to.path)) {
+      console.log(222222222222222)
       next({
         path: '/'
       });
       NProgress.done();
     } else {
+      console.log(store.getters.token)
       if (!store.getters.token) {
+        console.log(to)
         // 首次以及用户手动刷新,token都会还原回空字符串
         const accessRoutes = await store.dispatch('permission/generateRoutes');
         router.addRoutes(accessRoutes);
@@ -66,6 +70,7 @@ router.beforeEach(async (to, _, next) => {
         }
         next();
       } else {
+        console.log(22222)
         if (!whiteList.includes(to.path)) {
           checkLoginUser();
         }

+ 2 - 0
src/router/index.js

@@ -143,8 +143,10 @@ export function resetRouter() {
   router.matcher = newRouter.matcher // reset router
 }
 router.beforeEach(async (to, from, next) => {
+  console.log(to,from)
   // const { roles, isTrainDialog, guideInfo } = store.getters
   const { roles } = store.getters
+  console.log(roles)
   if (roles && roles.length && to.path !== '/help') {
     // if (Object.keys(guideInfo).length === 0) {
     //   store.dispatch('user/getTrainInfo')

+ 3 - 3
src/views/profitable/receipt.vue

@@ -14,11 +14,11 @@
         <el-form label-position='left'><div style='margin:30px 0;'>基本信息</div>
           <el-form-item  label-width='100px' label="用途" span="1" prop="contractNo" class="readonly">
             <ws-select v-model="deptBudgetList.purpose" placeholder="" class="typeselect" >
-              <ws-option label="合同费用" value="1"
+              <ws-option label="合同费用" value="合同费用"
                 style="color: #8890b1" />
-                <ws-option label="库点费用" value="2"
+                <ws-option label="库点费用" value="库点费用"
                 style="color: #8890b1" />
-                <ws-option label="经营性费用" value="3"
+                <ws-option label="经营性费用" value="经营性费用"
                 style="color: #8890b1" />
             </ws-select>
           </el-form-item>