Skip to content

Commit 745fed4

Browse files
PIKACHUIMCopilot
andauthored
add(driver): 123 official app (#79)
* add(driver): 123 official app * Update src/index.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Pikachu Ren <40362270+PIKACHUIM@users.noreply.github.com> --------- Signed-off-by: Pikachu Ren <40362270+PIKACHUIM@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent f021ae7 commit 745fed4

6 files changed

Lines changed: 17 additions & 6 deletions

File tree

public/static/event.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ function onSelect() {
7474
// }
7575
// 禁用部分驱动使用官方参数 ===========================================
7676
if (driver_txt_input.value === "baiduyun_ob" ||
77-
driver_txt_input.value === "123cloud_go" ||
7877
driver_txt_input.value === "onedrive_cn" ||
7978
driver_txt_input.value === "onedrive_us" ||
8079
driver_txt_input.value === "onedrive_de" ||

src/basic.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ app.use('*', async(c, next)=>{
2121
baiduyun_key: process.env.baiduyun_key || '',
2222
cloud115_uid: process.env.cloud115_uid || '',
2323
cloud115_key: process.env.cloud115_key || '',
24+
cloud123_uid: process.env.cloud123_uid || '',
25+
cloud123_key: process.env.cloud123_key || '',
2426
googleui_uid: process.env.googleui_uid || '',
2527
googleui_key: process.env.googleui_key || '',
2628
yandexui_uid: process.env.yandexui_uid || '',

src/driver/123cloud_oa.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ export async function oneLogin(c: Context) {
1515
const clients_info: configs.Clients | undefined = configs.getInfo(c);
1616
if (!clients_info) return c.json({text: "传入参数缺少"}, 500);
1717
const params_info: Record<string, any> = {
18-
clientId: clients_info.app_uid,
19-
clientSecret: clients_info.app_key,
18+
clientId: clients_info.servers ? c.env.cloud123_uid : clients_info.app_uid,
19+
clientSecret: clients_info.servers ? c.env.cloud123_key : clients_info.app_key,
2020
};
2121
if (!clients_info.servers)
2222
setCookie(c, clients_info)
23-
const result = await pubLogin(c, params_info, driver_map[0],
23+
const result = await pubLogin(c, JSON.stringify(params_info), driver_map[0],
2424
false, "POST", "json", {
2525
'Platform': "open_platform",
26-
'Content-Type': 'application/x-www-form-urlencoded'
26+
'Content-Type': 'application/json'
2727
});
2828
if (!result.data || !result.data.accessToken) return c.json({text: "无法获取AccessToken"}, 500);
2929
return c.json({text: result.data.accessToken}, 200);

src/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,19 @@ export type Bindings = {
2020
alicloud_uid: string, alicloud_key: string,
2121
baiduyun_uid: string, baiduyun_key: string,
2222
cloud115_uid: string, cloud115_key: string,
23+
cloud123_uid: string, cloud123_key: string,
2324
googleui_uid: string, googleui_key: string,
2425
yandexui_uid: string, yandexui_key: string,
2526
dropboxs_uid: string, dropboxs_key: string,
2627
}
2728

2829
export const app = new Hono<{ Bindings: Bindings }>()
2930

31+
// 媒体库应用页面 ########################################################################
32+
app.get('/app', async (c) => {
33+
return c.redirect('/index.html');
34+
})
35+
3036
// 登录申请 ##############################################################################
3137
app.get('/dropboxs/requests', async (c) => {
3238
return drops.getLogin(c);

wrangler.example.jsonc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
"dropboxs_uid": "*****************************",
2626
"dropboxs_key": "*****************************",
2727
"quarkpan_uid": "*****************************",
28-
"quarkpan_key": "*****************************"
28+
"quarkpan_key": "*****************************",
29+
"cloud123_uid": "*****************************",
30+
"cloud123_key": "*****************************"
2931
},
3032
"site": {
3133
"bucket": "./public"

wrangler.jsonc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
"dropboxs_key": "*****************************",
2727
"quarkpan_uid": "*****************************",
2828
"quarkpan_key": "*****************************",
29+
"cloud123_uid": "*****************************",
30+
"cloud123_key": "*****************************"
2931
},
3032
"site": {
3133
"bucket": "./public"

0 commit comments

Comments
 (0)