Przeglądaj źródła

TBTools-退出登录

panyong 4 lat temu
rodzic
commit
93f889ea11

+ 1 - 1
htmldev/TBTools/src/utils/httpRequest.js

@@ -27,7 +27,7 @@ http.interceptors.request.use(config => {
  * 响应拦截
  */
 http.interceptors.response.use(response => {
-  if (response.data && response.data.code === 401) { // 401, token失效
+  if (response.data && response.data.code === 403) { // 403, token失效
     clearLoginInfo()
     router.push({ name: 'login' })
   }

+ 2 - 2
htmldev/TBTools/src/views/main-navbar.vue

@@ -53,11 +53,11 @@ export default {
         type: 'warning'
       }).then(() => {
         this.$http({
-          url: this.$http.adornUrl('/sys/logout'),
+          url: this.$http.adornUrl('/user/loginout'),
           method: 'post',
           data: this.$http.adornData()
         }).then(({ data }) => {
-          if (data && data.code === 0) {
+          if (data.status) {
             clearLoginInfo()
             this.$router.push({ name: 'login' })
           }