update: The code structure is finished, and the project can run successfully

This commit is contained in:
QM303176530
2020-04-05 16:19:34 +08:00
parent 08ff55ffce
commit c755120c8d
16 changed files with 53 additions and 39 deletions

View File

@@ -21,13 +21,13 @@ const showLoading = () => {
}
const closeLoading = () => {
acitveAxios--
if (acitveAxios <= 0) {
clearTimeout(timer)
loadingInstance && loadingInstance.close()
}
acitveAxios--
if (acitveAxios <= 0) {
clearTimeout(timer)
loadingInstance && loadingInstance.close()
}
//http request 拦截器
}
//http request 拦截器
service.interceptors.request.use(
config => {
showLoading()
@@ -55,7 +55,7 @@ service.interceptors.request.use(
service.interceptors.response.use(
response => {
closeLoading()
if (response.data.success || response.headers.success === "true") {
if (response.data.code == 0 || response.headers.success === "true") {
return response.data
} else {
Message({