取消登录鉴权 取消路由重定向 创建动态表格组件 配置组件路由 (访问页面直接通过路由访问)
已修改4个文件
已删除3个文件
已添加2个文件
794 ■■■■ 文件已修改
Source/ProjectWeb/src/components/dynamic-components/dynamic-table.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/page/login/userlogin.vue 59 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/permission.js 152 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/router/page/index.js 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/views/system/PasswordManagement/Passwordresultant.vue 113 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/views/system/PasswordManagement/Passwordvalue.vue 131 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/views/system/PasswordManagement/passwords.vue 301 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/views/wel/dashboard.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
yarn.lock 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/components/dynamic-components/dynamic-table.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,13 @@
<template>
  <basic-container>表格测试页</basic-container>
</template>
<script>
export default {
  name: "dynamic-table"
}
</script>
<style scoped>
</style>
Source/ProjectWeb/src/page/login/userlogin.vue
@@ -165,35 +165,36 @@
        done();
      },
      handleLogin() {
        this.$refs.loginForm.validate(valid => {
          if (valid) {
            const loading = this.$loading({
              lock: true,
              text: '登录中,请稍后。。。',
              spinner: "el-icon-loading"
            });
            this.$store.dispatch("LoginByUsername", this.loginForm).then(() => {
              if (this.website.switchMode) {
                const deptId = this.userInfo.dept_id;
                const roleId = this.userInfo.role_id;
                if (deptId.includes(",") || roleId.includes(",")) {
                  this.loginForm.deptId = deptId;
                  this.loginForm.roleId = roleId;
                  this.userBox = true;
                  this.$store.dispatch("LogOut").then(() => {
                    loading.close();
                  });
                  return false;
                }
              }
              this.$router.push({path: this.tagWel.value});
              loading.close();
            }).catch(() => {
              loading.close();
            });
          }
        });
        this.$router.push({path: this.tagWel.value});
        // this.$refs.loginForm.validate(valid => {
        //   if (valid) {
        //     const loading = this.$loading({
        //       lock: true,
        //       text: '登录中,请稍后。。。',
        //       spinner: "el-icon-loading"
        //     });
        //     this.$store.dispatch("LoginByUsername", this.loginForm).then(() => {
        //       if (this.website.switchMode) {
        //         const deptId = this.userInfo.dept_id;
        //         const roleId = this.userInfo.role_id;
        //         if (deptId.includes(",") || roleId.includes(",")) {
        //           this.loginForm.deptId = deptId;
        //           this.loginForm.roleId = roleId;
        //           this.userBox = true;
        //           this.$store.dispatch("LogOut").then(() => {
        //             loading.close();
        //           });
        //           return false;
        //         }
        //       }
        //       this.$router.push({path: this.tagWel.value});
        //       loading.close();
        //     }).catch(() => {
        //       loading.close();
        //
        //     });
        //   }
        // });
      },
      getTenant() {
        let domain = getTopUrl();
Source/ProjectWeb/src/permission.js
@@ -1,76 +1,76 @@
/**
 * å…¨ç«™æƒé™é…ç½®
 *
 */
import router from './router/router'
import store from './store'
import {validatenull} from '@/util/validate'
import {getToken} from '@/util/auth'
import NProgress from 'nprogress' // progress bar
import 'nprogress/nprogress.css' // progress bar style
NProgress.configure({showSpinner: false});
const lockPage = store.getters.website.lockPage; //锁屏页
router.beforeEach((to, from, next) => {
  const meta = to.meta || {};
  const isMenu = meta.menu === undefined ? to.query.menu : meta.menu;
  store.commit('SET_IS_MENU', isMenu === undefined);
  if (getToken()) {
    if (store.getters.isLock && to.path !== lockPage) { //如果系统激活锁屏,全部跳转到锁屏页
      next({path: lockPage})
    } else if (to.path === '/login') { //如果登录成功访问登录页跳转到主页
      next({path: '/'})
    } else {
      //如果用户信息为空则获取用户信息,获取用户信息失败,跳转到登录页
      if (store.getters.token.length === 0) {
        store.dispatch('FedLogOut').then(() => {
          next({path: '/login'})
        })
      } else {
        const value = to.query.src || to.fullPath;
        const label = to.query.name || to.name;
        const meta = to.meta || router.$avueRouter.meta || {};
        const i18n = to.query.i18n;
        if (to.query.target) {
          window.open(value)
        } else if (meta.isTab !== false && !validatenull(value) && !validatenull(label)) {
          store.commit('ADD_TAG', {
            label: label,
            value: value,
            params: to.params,
            query: to.query,
            meta: (() => {
              if (!i18n) {
                return meta
              }
              return {
                i18n: i18n
              }
            })(),
            group: router.$avueRouter.group || []
          });
        }
        next()
      }
    }
  } else {
    //判断是否需要认证,没有登录访问去登录页
    if (meta.isAuth === false) {
      next()
    } else {
      next('/login')
    }
  }
})
router.afterEach(() => {
  NProgress.done();
  let title = store.getters.tag.label;
  let i18n = store.getters.tag.meta.i18n;
  title = router.$avueRouter.generateTitle(title, i18n);
  //判断登录页的情况
  if (router.history.current.fullPath === "/login") {
    title = "登录";
  }
  //根据当前的标签也获取label的值动态设置浏览器标题
  router.$avueRouter.setTitle(title);
});
// /**
//  * å…¨ç«™æƒé™é…ç½®
//  *
//  */
// import router from './router/router'
// import store from './store'
// import {validatenull} from '@/util/validate'
// import {getToken} from '@/util/auth'
// import NProgress from 'nprogress' // progress bar
// import 'nprogress/nprogress.css' // progress bar style
// NProgress.configure({showSpinner: false});
// const lockPage = store.getters.website.lockPage; //锁屏页
// router.beforeEach((to, from, next) => {
//   const meta = to.meta || {};
//   const isMenu = meta.menu === undefined ? to.query.menu : meta.menu;
//   store.commit('SET_IS_MENU', isMenu === undefined);
//   if (getToken()) {
//     if (store.getters.isLock && to.path !== lockPage) { //如果系统激活锁屏,全部跳转到锁屏页
//       next({path: lockPage})
//     } else if (to.path === '/login') { //如果登录成功访问登录页跳转到主页
//       next({path: '/'})
//     } else {
//       //如果用户信息为空则获取用户信息,获取用户信息失败,跳转到登录页
//       if (store.getters.token.length === 0) {
//         store.dispatch('FedLogOut').then(() => {
//           next({path: '/login'})
//         })
//       } else {
//         const value = to.query.src || to.fullPath;
//         const label = to.query.name || to.name;
//         const meta = to.meta || router.$avueRouter.meta || {};
//         const i18n = to.query.i18n;
//         if (to.query.target) {
//           window.open(value)
//         } else if (meta.isTab !== false && !validatenull(value) && !validatenull(label)) {
//           store.commit('ADD_TAG', {
//             label: label,
//             value: value,
//             params: to.params,
//             query: to.query,
//             meta: (() => {
//               if (!i18n) {
//                 return meta
//               }
//               return {
//                 i18n: i18n
//               }
//             })(),
//             group: router.$avueRouter.group || []
//           });
//         }
//         next()
//       }
//     }
//   } else {
//     //判断是否需要认证,没有登录访问去登录页
//     if (meta.isAuth === false) {
//       next()
//     } else {
//       next('/login')
//     }
//   }
// })
//
// router.afterEach(() => {
//   NProgress.done();
//   let title = store.getters.tag.label;
//   let i18n = store.getters.tag.meta.i18n;
//   title = router.$avueRouter.generateTitle(title, i18n);
//   //判断登录页的情况
//   if (router.history.current.fullPath === "/login") {
//     title = "登录";
//   }
//   //根据当前的标签也获取label的值动态设置浏览器标题
//   router.$avueRouter.setTitle(title);
// });
Source/ProjectWeb/src/router/page/index.js
@@ -32,7 +32,6 @@
      isTab: false,
      isAuth: false
    }
  },
  {
    path: '/403',
@@ -77,5 +76,23 @@
  {
    path: '*',
    redirect: '/404'
  },
  {
    path: '/dynamic-table',
    name: '动态表格页面',
    component: Layout,
    children: [
      {
        path: '', // ç©ºè·¯å¾„表示访问 '/dynamic-table' æ—¶åŠ è½½ Layout ç»„ä»¶
        component: () => import('@/components/dynamic-components/dynamic-table'),
        props: true
      }
    ]
  },
  {
    path: '/dynamic-table',
    name: '动态表格页面',
    component: Layout,
    props: true
  }
]
Source/ProjectWeb/src/views/system/PasswordManagement/Passwordresultant.vue
ÎļþÒÑɾ³ý
Source/ProjectWeb/src/views/system/PasswordManagement/Passwordvalue.vue
ÎļþÒÑɾ³ý
Source/ProjectWeb/src/views/system/PasswordManagement/passwords.vue
ÎļþÒÑɾ³ý
Source/ProjectWeb/src/views/wel/dashboard.vue
@@ -1,4 +1,4 @@
<template>
、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、<template>
  <basic-container>
    <div class="wel">
      <basic-block :width="width"
yarn.lock
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,4 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1