|
|
@@ -9,9 +9,9 @@ const service = axios.create({
|
|
|
const lang = localStorage.getItem('lang') || 'cn'
|
|
|
service.interceptors.request.use(
|
|
|
config => {
|
|
|
- // if (config.isLoading) {
|
|
|
- // startLoading()
|
|
|
- // }
|
|
|
+ if (config.isLoading) {
|
|
|
+ startLoading()
|
|
|
+ }
|
|
|
if (localStorage.getItem('userToken')) {
|
|
|
config.headers.Authorization = localStorage.getItem('userToken')
|
|
|
}
|
|
|
@@ -24,9 +24,9 @@ service.interceptors.request.use(
|
|
|
|
|
|
service.interceptors.response.use(
|
|
|
response => {
|
|
|
- // if (response.config.isLoading) {
|
|
|
- // endLoading();
|
|
|
- // }
|
|
|
+ if (response.config.isLoading) {
|
|
|
+ endLoading();
|
|
|
+ }
|
|
|
const res = response.data
|
|
|
if (res.code === 0) {
|
|
|
// Message({
|
|
|
@@ -77,7 +77,7 @@ let loading
|
|
|
function startLoading() {
|
|
|
loading = Loading.service({
|
|
|
lock: true,
|
|
|
- text: '加载中',
|
|
|
+ text: 'loading...',
|
|
|
background: 'rgba(0, 0, 0, 0.7)'
|
|
|
})
|
|
|
}
|