智慧农业后台管理页面
guoshilong
2022-09-26 cf9495cfb1424816167586fa985ecdf29a923eea
替换原登录页为统一登录页
3 files modified
11 ■■■■ 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/router/axios.js 5 ●●●● patch | view | raw | blame | history
src/page/lock/index.vue
@@ -49,7 +49,8 @@
        type: "warning"
      }).then(() => {
        this.$store.dispatch("LogOut").then(() => {
          this.$router.push({ path: "/login" });
          // this.$router.push({ path: "/login" });
          window.opener.location.href = 'http://dev.jxpskj.com:8020/ncny/login.html'
        });
      });
    },
src/page/login/authredirect.vue
@@ -10,7 +10,8 @@
    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 = `${window.location.origin}/#/login?state=${state}&code=${code}`
    window.opener.location.href = 'http://dev.jxpskj.com:8020/ncny/login.html'
  }
}
</script>
src/router/axios.js
@@ -67,7 +67,10 @@
  //如果在白名单里则自行catch逻辑处理
  if (statusWhiteList.includes(status)) return Promise.reject(res);
  //如果是401则跳转到登录页面
  if (status === 401) store.dispatch('FedLogOut').then(() => router.push({path: '/login'}));
  if (status === 401) store.dispatch('FedLogOut').then(() =>
    // router.push({path: '/login'})
    window.opener.location.href = 'http://dev.jxpskj.com:8020/ncny/login.html'
  );
  // 如果请求为非200否者默认统一处理
  if (status !== 200) {
    Message({