Skip to content

Commit 8db7356

Browse files
committed
mod(driver): add google retry
1 parent d6b08cf commit 8db7356

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/driver/googleui_oa.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ function getRandomString(length: number): string {
142142
export async function genToken(c: Context) {
143143
const clients_info: configs.Clients | undefined = configs.getInfo(c);
144144
const refresh_text: string | undefined = c.req.query('refresh_ui');
145+
let server_url: string = driver_map[1];
146+
if (c.env.PROXY_API.length > 0) server_url = "https://" + c.env.PROXY_API + "/token";
145147
if (!clients_info) return c.json({text: "传入参数缺少"}, 500);
146148
if (!refresh_text) return c.json({text: "缺少刷新令牌"}, 500);
147149
// 请求参数 ==========================================================================
@@ -151,5 +153,5 @@ export async function genToken(c: Context) {
151153
grant_type: 'refresh_token',
152154
refresh_token: refresh_text
153155
};
154-
return await refresh.pubRenew(c, driver_map[1], params, "POST", "access_token", "copy", "none");
156+
return await refresh.pubRenew(c, server_url, params, "POST", "access_token", "copy", "none");
155157
}

0 commit comments

Comments
 (0)