Skip to content

Commit b28d6cc

Browse files
committed
fix(driver): aliyun drive login error
1 parent d023901 commit b28d6cc

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/driver/alicloud_oa.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ export async function alyLogin(c: Context) {
6464
const result = await pubLogin(c, JSON.stringify(params_info), request_urls,
6565
false, "POST", "json",
6666
{'Content-Type': 'application/json'});
67-
// console.log(result);
68-
if (!result.qrCodeUrl) return c.json({"text": result.stringify()}, 500);
67+
if (!result.qrCodeUrl) return c.json({"text": result.message}, 500);
6968
return c.json({"text": result.qrCodeUrl, "sid": result.sid}, 200);
7069
}
7170

src/shares/request.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ export async function Requests(c: Context,
1414
let parma_str: string;
1515
const parma_url = new URL(APIUrl);
1616
if (typeof Params !== "string") {
17-
parma_str = new URLSearchParams(Params).toString();
17+
const params_map = Object.fromEntries(
18+
Object.entries(Params).map(([k, v]) => [k, String(v ?? '')])
19+
);
20+
parma_str = new URLSearchParams(params_map).toString();
1821
Object.keys(Params).forEach(key => {
1922
parma_url.searchParams.append(key, Params[key]);
2023
});

0 commit comments

Comments
 (0)