Skip to content

Commit

Permalink
fix(core): 添加题库配置 method 大小写适配
Browse files Browse the repository at this point in the history
  • Loading branch information
enncy committed Nov 25, 2023
1 parent c0ac30c commit d496be7
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export async function defaultAnswerWrapperHandler(
let requestData;
// 请求地址
let url: URL;
if (method === 'get') {
if (method.toLocaleLowerCase() === 'get') {
url = new URL(resolvePlaceHolder(wrapper.url, { encodeURI: true }));
/**
* 如果 data 存在数据并且 method 为 get,则将 data 数据拼接到 url 上,覆盖原有的 url 同名参数
Expand All @@ -78,7 +78,7 @@ export async function defaultAnswerWrapperHandler(
});
// get 的请求数据为空
requestData = {};
} else if (method === 'post') {
} else if (method.toLocaleLowerCase() === 'post') {
url = new URL(wrapper.url);
// 构造请求数据
const data: Record<string, string> = Object.create({});
Expand Down

0 comments on commit d496be7

Please sign in to comment.