zcy hace 4 años
padre
commit
063008a0e9
Se han modificado 3 ficheros con 10 adiciones y 10 borrados
  1. 1 1
      .env.production
  2. 8 8
      src/utils/request.js
  3. 1 1
      src/views/login/index.vue

+ 1 - 1
.env.production

@@ -2,5 +2,5 @@
 ENV = 'production'
 
 # base api
-VUE_APP_BASE_API = 'http://railway.iamsee.com'
+VUE_APP_BASE_API = 'http://railway.iamsee.com/api'
 

+ 8 - 8
src/utils/request.js

@@ -56,14 +56,14 @@ service.interceptors.response.use(
 
       // 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired;
       if (res.code === 401) {
-        // to re-login
-        Message({
-          message: '请重新登录',
-          type: 'error',
-          duration: 3 * 1000
-        })
-        store.dispatch('user/resetToken').then(() => {
-          location.reload()
+        MessageBox.confirm('请重新登录', {
+          confirmButtonText: '重新登录',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          store.dispatch('user/resetToken').then(() => {
+            location.reload()
+          })
         })
       }
       return Promise.reject(new Error(res.msg || 'Error'))

+ 1 - 1
src/views/login/index.vue

@@ -139,9 +139,9 @@ export default {
   methods: {
     captchaImage() {
       captchaImage({ type: 'math' }).then(res => {
-        debugger
         const url = 'data:image/jpg;base64,' + res.img
         this.imgSrc = url
+        this.loginForm.uuid = res.uuid
       })
     },
     showPwd() {