feat(web): 同步预约演示与兜底渠道优化
This commit is contained in:
@@ -6,14 +6,15 @@ export async function requestWebsite(
|
||||
url,
|
||||
body,
|
||||
fallback = '请求失败,请稍后重试',
|
||||
{ params, signal } = {},
|
||||
) {
|
||||
let response;
|
||||
try {
|
||||
const options = { skipErrorHandler: true, timeout: 20000 };
|
||||
const options = { skipErrorHandler: true, timeout: 20000, params, signal };
|
||||
response =
|
||||
method === 'get'
|
||||
? await API.get(url, options)
|
||||
: await API.post(url, body, options);
|
||||
method === 'get' || method === 'delete'
|
||||
? await API[method](url, options)
|
||||
: await API[method](url, body, options);
|
||||
} catch (error) {
|
||||
if (error.response?.status === 401) {
|
||||
showError(error);
|
||||
|
||||
Reference in New Issue
Block a user