in src/utils/request.js [63:90]
message: getIntlContent("SHENYU.MESSAGE.SESSION.INVALID"),
description: getIntlContent("SHENYU.MESSAGE.SESSION.RELOGIN"),
});
const error = new Error(response.message);
error.name = response.code;
error.response = response;
throw error;
} else {
return true;
}
};
/**
* Requests a URL, returning a promise.
*
* @param {string} url The URL we want to request
* @param {object} [options] The options we want to pass to "fetch"
* @return {object} An object containing either "data" or "err"
*/
export default function request(url, options) {
const defaultOptions = {};
const newOptions = { ...defaultOptions, ...options };
if (
newOptions.method === "POST" ||
newOptions.method === "PUT" ||
newOptions.method === "DELETE"
) {
if (!(newOptions.body instanceof FormData)) {