Skip to content

Commit

Permalink
feat: 上传错误则使用脚本上传
Browse files Browse the repository at this point in the history
  • Loading branch information
lisonge committed Oct 8, 2023
1 parent 62b8236 commit 383dd51
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/utils/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,9 @@ export const uploadPoliciesAssets = async (
const xRpcOk = resp.headers.get('X_RPC_OK');
if (xRpcOk === 'true') {
return resp.json();
} else if (xRpcOk === 'false') {
throw new Error((await resp.json()).message);
} else {
throw new Error(await resp.text());
}
// 如果上传失败, 使用油猴脚本上传
return uploadPoliciesAssetsByExtension(bf);
};

export const uploadPoliciesAssetsByExtension = async (bf: ArrayBuffer) => {
Expand Down

0 comments on commit 383dd51

Please sign in to comment.