Browse Source

增加屏蔽loading功能

main
pixel 4 years ago
parent
commit
9512db401b
  1. 29
      web/src/api/system.js
  2. 5
      web/src/utils/request.js

29
web/src/api/system.js

@ -7,10 +7,10 @@ import service from "@/utils/request";
// @Success 200 {string} string "{"success":true,"data":{},"msg":"返回成功"}" // @Success 200 {string} string "{"success":true,"data":{},"msg":"返回成功"}"
// @Router /system/getSystemConfig [post] // @Router /system/getSystemConfig [post]
export const getSystemConfig = () => { export const getSystemConfig = () => {
return service({
url: "/system/getSystemConfig",
method: "post",
});
return service({
url: "/system/getSystemConfig",
method: "post",
});
}; };
// @Tags system // @Tags system
@ -21,11 +21,11 @@ export const getSystemConfig = () => {
// @Success 200 {string} string "{"success":true,"data":{},"msg":"返回成功"}" // @Success 200 {string} string "{"success":true,"data":{},"msg":"返回成功"}"
// @Router /system/setSystemConfig [post] // @Router /system/setSystemConfig [post]
export const setSystemConfig = (data) => { export const setSystemConfig = (data) => {
return service({
url: "/system/setSystemConfig",
method: "post",
data,
});
return service({
url: "/system/setSystemConfig",
method: "post",
data,
});
}; };
// @Tags system // @Tags system
@ -35,8 +35,9 @@ export const setSystemConfig = (data) => {
// @Success 200 {string} string "{"success":true,"data":{},"msg":"返回成功"}" // @Success 200 {string} string "{"success":true,"data":{},"msg":"返回成功"}"
// @Router /system/getServerInfo [post] // @Router /system/getServerInfo [post]
export const getSystemState = () => { export const getSystemState = () => {
return service({
url: "/system/getServerInfo",
method: "post",
});
};
return service({
url: "/system/getServerInfo",
method: "post",
donNotShowLoading: true
});
};

5
web/src/utils/request.js

@ -30,7 +30,10 @@ const closeLoading = () => {
//http request 拦截器 //http request 拦截器
service.interceptors.request.use( service.interceptors.request.use(
config => { config => {
showLoading()
console.log(config)
if (!config.donNotShowLoading) {
showLoading()
}
const token = store.getters['user/token'] const token = store.getters['user/token']
const user = store.getters['user/userInfo'] const user = store.getters['user/userInfo']
config.data = JSON.stringify(config.data); config.data = JSON.stringify(config.data);

Loading…
Cancel
Save