智慧农业后台管理页面
guoshilong
2022-09-27 afa8ee521affdce4f4cac9ba32ede9d22b76a13e
还原之前更改,用户登录跳转到统一登陆页面
4 files modified
17 ■■■■ changed files
src/page/lock/index.vue 3 ●●●● patch | view | raw | blame | history
src/page/login/authredirect.vue 3 ●●●● patch | view | raw | blame | history
src/page/login/userlogin.vue 8 ●●●● patch | view | raw | blame | history
src/router/axios.js 3 ●●●● patch | view | raw | blame | history
src/page/lock/index.vue
@@ -49,8 +49,7 @@
        type: "warning"
      }).then(() => {
        this.$store.dispatch("LogOut").then(() => {
          // this.$router.push({ path: "/login" });
          window.opener.location.href = 'http://dev.jxpskj.com:8020/ncny/login.html'
          this.$router.push({ path: "/login" });
        });
      });
    },
src/page/login/authredirect.vue
@@ -10,8 +10,7 @@
    const params = this.$route.query
    const state = params.state
    const code = params.code
    // window.opener.location.href = `${window.location.origin}/#/login?state=${state}&code=${code}`
    window.opener.location.href = 'http://dev.jxpskj.com:8020/ncny/login.html'
    window.opener.location.href = `${window.location.origin}/#/login?state=${state}&code=${code}`
  }
}
</script>
src/page/login/userlogin.vue
@@ -169,14 +169,18 @@
    created() {
      this.getTenant();
      this.refreshCode();
    },
    mounted() {
      //统一登录有没有登录
      const token = window.sessionStorage.getItem('token')
      if (token) {
        this.loginInfoByToken();
      }else{
        //跳转到本地登录页时跳转到统一登录
        window.location.replace('http://dev.jxpskj.com:8020/ncny/login.html')
      }
    },
    mounted() {
    },
    watch: {
      'loginForm.deptId'() {
        const column = this.findObject(this.userOption.column, "deptId");
src/router/axios.js
@@ -68,8 +68,7 @@
  if (statusWhiteList.includes(status)) return Promise.reject(res);
  //如果是401则跳转到登录页面
  if (status === 401) store.dispatch('FedLogOut').then(() => 
    // router.push({path: '/login'})
    window.opener.location.href = 'http://dev.jxpskj.com:8020/ncny/login.html'
    router.push({path: '/login'})
  );
  // 如果请求为非200否者默认统一处理
  if (status !== 200) {