田源
2024-04-01 79f117e8cfb90586753503582dfff2b999d6c436
取消登录鉴权注释代码
已修改4个文件
146 ■■■■ 文件已修改
Source/ProjectWeb/src/page/index/sidebar/sidebarItem.vue 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/page/login/userlogin.vue 60 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/router/axios.js 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/router/page/index.js 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/page/index/sidebar/sidebarItem.vue
@@ -2,37 +2,37 @@
  <div class="menu-wrapper">
    <template v-for="item in menu">
      <el-menu-item v-if="validatenull(item[childrenKey]) && vaildRoles(item)"
                    :index="item[pathKey]"
                    @click="open(item)"
                    :key="item[labelKey]"
                    :class="{'is-active':vaildActive(item)}">
                    :class="{'is-active':vaildActive(item)}"
                    :index="item[pathKey]"
                    @click="open(item)">
        <i :class="item[iconKey]"></i>
        <span slot="title"
              :alt="item[pathKey]">{{generateTitle(item)}}</span>
      </el-menu-item>
      <el-submenu v-else-if="!validatenull(item[childrenKey])&&vaildRoles(item)"
                  :index="item[pathKey]"
                  :key="item[labelKey]">
                  :key="item[labelKey]"
                  :index="item[pathKey]">
        <template slot="title">
          <i :class="item[iconKey]"></i>
          <span slot="title"
                :class="{'el-menu--display':collapse && first}">{{generateTitle(item)}}</span>
        </template>
        <template v-for="(child,cindex) in item[childrenKey]">
          <el-menu-item :index="child[pathKey],cindex"
                        @click="open(child)"
          <el-menu-item v-if="validatenull(child[childrenKey])"
                        :key="child[labelKey]"
                        :class="{'is-active':vaildActive(child)}"
                        v-if="validatenull(child[childrenKey])"
                        :key="child[labelKey]">
                        :index="child[pathKey],cindex"
                        @click="open(child)">
            <i :class="child[iconKey]"></i>
            <span slot="title">{{generateTitle(child)}}</span>
          </el-menu-item>
          <sidebar-item v-else
                        :menu="[child]"
                        :key="cindex"
                        :collapse="collapse"
                        :menu="[child]"
                        :props="props"
                        :screen="screen"
                        :collapse="collapse"></sidebar-item>
                        :screen="screen"></sidebar-item>
        </template>
      </el-submenu>
    </template>
Source/ProjectWeb/src/page/login/userlogin.vue
@@ -165,36 +165,36 @@
        done();
      },
      handleLogin() {
        // 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();
        //
        //     });
        //   }
        // });
        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/router/axios.js
@@ -55,30 +55,30 @@
}, error => {
  return Promise.reject(error)
});
// //http response 拦截
// axios.interceptors.response.use(res => {
//   //关闭 progress bar
//   NProgress.done();
//   //获取状态码
//   const status = res.data.code || res.status;
//   const statusWhiteList = website.statusWhiteList || [];
//   const message = res.data.msg || res.data.error_description || '未知错误';
//   //如果在白名单里则自行catch逻辑处理
//   if (statusWhiteList.includes(status)) return Promise.reject(res);
//   //如果是401则跳转到登录页面
//   if (status === 401) store.dispatch('FedLogOut').then(() => router.push({path: '/login'}));
//   // 如果请求为非200否者默认统一处理
//   if (status !== 200) {
//     Message({
//       message: message,
//       type: 'error'
//     });
//     return Promise.reject(new Error(message))
//   }
//   return res;
// }, error => {
//   NProgress.done();
//   return Promise.reject(new Error(error));
// });
//http response 拦截
axios.interceptors.response.use(res => {
  //关闭 progress bar
  NProgress.done();
  //获取状态码
  const status = res.data.code || res.status;
  const statusWhiteList = website.statusWhiteList || [];
  const message = res.data.msg || res.data.error_description || '未知错误';
  //如果在白名单里则自行catch逻辑处理
  if (statusWhiteList.includes(status)) return Promise.reject(res);
  //如果是401则跳转到登录页面
  if (status === 401) store.dispatch('FedLogOut').then(() => router.push({path: '/login'}));
  // 如果请求为非200否者默认统一处理
  if (status !== 200) {
    Message({
      message: message,
      type: 'error'
    });
    return Promise.reject(new Error(message))
  }
  return res;
}, error => {
  NProgress.done();
  return Promise.reject(new Error(error));
});
export default axios;
Source/ProjectWeb/src/router/page/index.js
@@ -77,18 +77,6 @@
    path: '*',
    redirect: '/404'
  },
  // {
  //   path: '/UIContentViewer',
  //   name: 'UI上下文',
  //   component: Layout,
  //   children: [
  //     {
  //       path: '',
  //       component: () => import("@/views/base/UIContentViewer"),
  //       props: true
  //     }
  //   ]
  // },
  {
    path: '/dynamic-form',
    name: '动态表格页面',