联调接口
This commit is contained in:
@@ -28,7 +28,7 @@ export const showAlert = (content, title = '提示',showCancel=false,succFun) =>
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
// console.log('用户点击确定');
|
||||
succFun();
|
||||
if(succFun)succFun();
|
||||
} else if (res.cancel) {
|
||||
// console.log('用户点击取消');
|
||||
}
|
||||
|
||||
@@ -11,7 +11,8 @@ const message = useMessage();
|
||||
const requestHooks = {
|
||||
// 请求拦截器
|
||||
requestInterceptorsHook(options, config) {
|
||||
// console.log("request=>",options,config)
|
||||
console.log("request=>",options);
|
||||
// console.log("request=>config=>",config)
|
||||
const { urlPrefix, baseUrl, withToken, isAuth } = config;
|
||||
options.header = options.header ?? {};
|
||||
if (urlPrefix) {
|
||||
@@ -20,7 +21,7 @@ const requestHooks = {
|
||||
if (baseUrl) {
|
||||
options.url = `${baseUrl}${options.url}`;
|
||||
}
|
||||
const token = getToken();
|
||||
const token = getToken(); console.log("token=>",token)
|
||||
if (withToken && !options.header.token) {
|
||||
options.header.token = token;
|
||||
}
|
||||
@@ -28,7 +29,8 @@ const requestHooks = {
|
||||
},
|
||||
// 响应拦截器
|
||||
responseInterceptorsHook(response, config) {
|
||||
// console.log("response=>",response,config)
|
||||
console.log("response=>",response)
|
||||
// console.log("response=>config=>",config)
|
||||
const { isTransformResponse, isReturnDefaultResponse, isAuth } = config;
|
||||
|
||||
if (isReturnDefaultResponse) {
|
||||
|
||||
Reference in New Issue
Block a user