租房小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

24 lines
738 B

"use strict";
const common_vendor = require("../../common/vendor.js");
const responseInterceptors = (vm) => {
common_vendor.index.$uv.http.interceptors.response.use((response) => {
var _a;
const data = response.data;
const custom = (_a = response.config) == null ? void 0 : _a.custom;
if (data.code !== 200) {
if (custom.toast !== false) {
common_vendor.index.$uv.toast(data.message);
}
if (custom == null ? void 0 : custom.catch) {
return Promise.reject(data);
} else {
return new Promise(() => {
});
}
}
return data.data || {};
}, (response) => {
return Promise.reject(response);
});
};
exports.responseInterceptors = responseInterceptors;