|
|
@@ -99,10 +99,15 @@ axios.interceptors.response.use(
|
|
|
return Promise.reject(err.message)
|
|
|
}
|
|
|
)
|
|
|
-export default (urlObj, data = {}, method = 'POST', responseType = 'json') => {
|
|
|
+export default async (urlObj, data = {}, method = 'POST', responseType = 'json') => {
|
|
|
store.commit('webapi/set', { urlObj, value: Config.enums.request.before.storeValue })
|
|
|
+ // 存在 前置通知
|
|
|
+ if (urlObj.AOP && urlObj.AOP.BA) {
|
|
|
+ await Promise.all(urlObj.AOP.BA.map(fn => fn(urlObj)))
|
|
|
+ }
|
|
|
return axios({ url: urlObj.realUrl, method, data, responseType: urlObj.responseType || responseType }).then(async res => {
|
|
|
store.commit('webapi/set', { urlObj, value: Config.enums.request.sus.storeValue })
|
|
|
+ // 存在 后置通知
|
|
|
if (urlObj.AOP && urlObj.AOP.AR) {
|
|
|
await urlObj.AOP.AR.forEach(fn => fn(urlObj, res))
|
|
|
}
|