This commit is contained in:
2023-12-15 14:15:29 +08:00
parent 132f0a745b
commit 5f78407bb3
3 changed files with 12 additions and 14 deletions

View File

@@ -1,5 +1,5 @@
import axios from 'axios' import axios from 'axios'
import { Dialog } from './utils.js' // import { Dialog } from './utils.js'
import store from '../vuex/store' import store from '../vuex/store'
import router from '@/router' import router from '@/router'
import i18n from '../i18n/i18n' import i18n from '../i18n/i18n'
@@ -37,7 +37,7 @@ axios.interceptors.response.use(
if (error && error.response) { if (error && error.response) {
switch (error.response.status) { switch (error.response.status) {
case 400: case 400:
Dialog(error.message) // Dialog(error.message)
break break
case 401: case 401:
store.dispatch('setSignOut') store.dispatch('setSignOut')

View File

@@ -164,17 +164,15 @@ export default {
} catch (err) { } catch (err) {
this.disabled = false this.disabled = false
// this.toast(err) // this.toast(err)
if (err.status !== 400) { const loading = this.$loading({
const loading = this.$loading({ lock: true,
lock: true, text: this.$t('common.loading'),
text: this.$t('common.loading'), spinner: 'el-icon-loading',
spinner: 'el-icon-loading', background: 'rgba(0, 0, 0, 0.7)'
background: 'rgba(0, 0, 0, 0.7)' })
}) setTimeout(() => {
setTimeout(() => { loading.close()
loading.close() }, 4000)
}, 4000)
}
} }
}, },
show (e) { show (e) {

View File

@@ -2,7 +2,7 @@ import * as types from '../types'
import { getStore, setStore } from '@config/utils.js' import { getStore, setStore } from '@config/utils.js'
const baseUrl = process.env.NODE_ENV === 'development' ? 'http://43.139.166.161:8018' : 'http://localhost:8018' const baseUrl = process.env.NODE_ENV === 'development' ? 'http://43.139.166.161:8018' : 'http://localhost:8018'
const setTime = '3000' const setTime = '1000'
const state = { const state = {
baseUrl: getStore('baseUrl') || baseUrl, baseUrl: getStore('baseUrl') || baseUrl,
setTime: getStore('setTime') || setTime, setTime: getStore('setTime') || setTime,