|
|
|
@ -41,7 +41,6 @@ export async function PostJson<T = object>(url: string, body: Exclude<T, BodyIni
|
|
|
|
|
|
|
|
|
|
export async function Post(url: string, body?: BodyInit, isShowErrMsg = true): Promise<IResponseData>
|
|
|
|
|
{
|
|
|
|
|
let stringRespon: string;
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
let res = await fetch(url, {
|
|
|
|
@ -50,7 +49,6 @@ export async function Post(url: string, body?: BodyInit, isShowErrMsg = true): P
|
|
|
|
|
credentials: "include",
|
|
|
|
|
body,
|
|
|
|
|
});
|
|
|
|
|
stringRespon = await res.text();
|
|
|
|
|
let result = await res.json();
|
|
|
|
|
let store = TopPanelStore.GetInstance() as TopPanelStore;
|
|
|
|
|
switch (result.err_code)
|
|
|
|
@ -83,7 +81,7 @@ export async function Post(url: string, body?: BodyInit, isShowErrMsg = true): P
|
|
|
|
|
}
|
|
|
|
|
catch (error)
|
|
|
|
|
{
|
|
|
|
|
ReportError(`请求url错误:${url},字符串结果:${stringRespon}`);
|
|
|
|
|
ReportError(`请求url错误:${url}`);
|
|
|
|
|
return { err_code: RequestStatus.None, err_msg: "请求错误" };
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|