deal google & 123 pan

This commit is contained in:
pikachuim 2025-06-13 19:26:04 +08:00
parent 29ec2fdf59
commit efab5ee9b0
11 changed files with 515 additions and 120 deletions

1
.gitignore vendored
View File

@ -10,3 +10,4 @@ yarn-error.log*
.vscode/*
.wrangler/*
wrangler.jsonc

29
.idea/workspace.xml generated
View File

@ -5,20 +5,14 @@
</component>
<component name="ChangeListManager">
<list default="true" id="987ac7e2-ceaa-49a2-b5c9-aed65a7c598d" name="更改" comment="deal 115 baidu cloud">
<change afterPath="$PROJECT_DIR$/public/test.html" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/115ui.ts" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/baidu.ts" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/error.ts" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/goapi.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/dictionaries/project.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/dictionaries/project.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/README.md" afterDir="false" />
<change beforePath="$PROJECT_DIR$/package-lock.json" beforeDir="false" afterPath="$PROJECT_DIR$/package-lock.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/public/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/public/index.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/aliui.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/aliui.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/115ui.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/115ui.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/goapi.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/goapi.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/index.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/index.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/oneui.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/oneui.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/wrangler.jsonc" beforeDir="false" afterPath="$PROJECT_DIR$/wrangler.jsonc" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -52,7 +46,7 @@
"RunOnceActivity.ShowReadmeOnStart": "true",
"RunOnceActivity.git.unshallow": "true",
"git-widget-placeholder": "main",
"last_opened_file_path": "G:/AList/cf-worker-api/src",
"last_opened_file_path": "G:/AList/cf-worker-api",
"node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true",
"node.js.selected.package.eslint": "(autodetect)",
@ -65,8 +59,9 @@
}]]></component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
<recent name="G:\AList\cf-worker-api\src" />
<recent name="G:\AList\cf-worker-api" />
<recent name="G:\AList\cf-worker-api\public" />
<recent name="G:\AList\cf-worker-api\src" />
</key>
<key name="MoveFile.RECENT_KEYS">
<recent name="G:\AList\cf-worker-api\public" />
@ -88,7 +83,7 @@
<updated>1749696640494</updated>
<workItem from="1749696641557" duration="119000" />
<workItem from="1749696773818" duration="18000" />
<workItem from="1749696801474" duration="43946000" />
<workItem from="1749696801474" duration="51180000" />
</task>
<task id="LOCAL-00001" summary="fin onedrive official token">
<option name="closed" value="true" />
@ -138,7 +133,15 @@
<option name="project" value="LOCAL" />
<updated>1749720117274</updated>
</task>
<option name="localTasksCounter" value="7" />
<task id="LOCAL-00007" summary="deal 115 baidu cloud">
<option name="closed" value="true" />
<created>1749806487624</created>
<option name="number" value="00007" />
<option name="presentableId" value="LOCAL-00007" />
<option name="project" value="LOCAL" />
<updated>1749806487624</updated>
</task>
<option name="localTasksCounter" value="8" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">

280
package-lock.json generated
View File

@ -9,7 +9,8 @@
"@cloudflare/workers-types": "^4.20250610.0",
"@google-cloud/local-auth": "^2.1.0",
"googleapis": "^105.0.0",
"hono": "^4.7.11"
"hono": "^4.7.11",
"http-server": "^14.1.1"
},
"devDependencies": {
"wrangler": "^4.4.0"
@ -1052,6 +1053,21 @@
"node": ">= 6.0.0"
}
},
"node_modules/ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"license": "MIT",
"dependencies": {
"color-convert": "^2.0.1"
},
"engines": {
"node": ">=8"
},
"funding": {
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
"node_modules/arrify": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz",
@ -1071,6 +1087,12 @@
"printable-characters": "^1.0.42"
}
},
"node_modules/async": {
"version": "3.2.6",
"resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz",
"integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==",
"license": "MIT"
},
"node_modules/base64-js": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
@ -1091,6 +1113,24 @@
],
"license": "MIT"
},
"node_modules/basic-auth": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz",
"integrity": "sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==",
"license": "MIT",
"dependencies": {
"safe-buffer": "5.1.2"
},
"engines": {
"node": ">= 0.8"
}
},
"node_modules/basic-auth/node_modules/safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
"license": "MIT"
},
"node_modules/bignumber.js": {
"version": "9.3.0",
"resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.3.0.tgz",
@ -1142,6 +1182,22 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"license": "MIT",
"dependencies": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
},
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/chalk/chalk?sponsor=1"
}
},
"node_modules/color": {
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz",
@ -1160,7 +1216,6 @@
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"color-name": "~1.1.4"
@ -1173,7 +1228,6 @@
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"license": "MIT"
},
"node_modules/color-string": {
@ -1197,6 +1251,15 @@
"node": ">= 0.6"
}
},
"node_modules/corser": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/corser/-/corser-2.0.1.tgz",
"integrity": "sha512-utCYNzRSQIZNPIcGZdQc92UVJYAhtGAteCFg0yRaFm8f0P+CPtyGyHXJcGXnffjCybUCEx3FQ2G7U3/o9eIkVQ==",
"license": "MIT",
"engines": {
"node": ">= 0.4.0"
}
},
"node_modules/data-uri-to-buffer": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-2.0.2.tgz",
@ -1332,6 +1395,12 @@
"@esbuild/win32-x64": "0.25.4"
}
},
"node_modules/eventemitter3": {
"version": "4.0.7",
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz",
"integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==",
"license": "MIT"
},
"node_modules/exit-hook": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/exit-hook/-/exit-hook-2.2.1.tgz",
@ -1364,6 +1433,26 @@
"integrity": "sha512-VhXlQgj9ioXCqGstD37E/HBeqEGV/qOD/kmbVG8h5xKBYvM1L3lR1Zn4555cQ8GkYbJa8aJSipLPndE1k6zK2w==",
"license": "Apache-2.0"
},
"node_modules/follow-redirects": {
"version": "1.15.9",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz",
"integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==",
"funding": [
{
"type": "individual",
"url": "https://github.com/sponsors/RubenVerborgh"
}
],
"license": "MIT",
"engines": {
"node": ">=4.0"
},
"peerDependenciesMeta": {
"debug": {
"optional": true
}
}
},
"node_modules/fsevents": {
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
@ -1563,6 +1652,15 @@
"node": ">=12.0.0"
}
},
"node_modules/has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"license": "MIT",
"engines": {
"node": ">=8"
}
},
"node_modules/has-symbols": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",
@ -1587,6 +1685,15 @@
"node": ">= 0.4"
}
},
"node_modules/he": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz",
"integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==",
"license": "MIT",
"bin": {
"he": "bin/he"
}
},
"node_modules/hono": {
"version": "4.7.11",
"resolved": "https://registry.npmjs.org/hono/-/hono-4.7.11.tgz",
@ -1596,6 +1703,71 @@
"node": ">=16.9.0"
}
},
"node_modules/html-encoding-sniffer": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz",
"integrity": "sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==",
"license": "MIT",
"dependencies": {
"whatwg-encoding": "^2.0.0"
},
"engines": {
"node": ">=12"
}
},
"node_modules/http-proxy": {
"version": "1.18.1",
"resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz",
"integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==",
"license": "MIT",
"dependencies": {
"eventemitter3": "^4.0.0",
"follow-redirects": "^1.0.0",
"requires-port": "^1.0.0"
},
"engines": {
"node": ">=8.0.0"
}
},
"node_modules/http-server": {
"version": "14.1.1",
"resolved": "https://registry.npmjs.org/http-server/-/http-server-14.1.1.tgz",
"integrity": "sha512-+cbxadF40UXd9T01zUHgA+rlo2Bg1Srer4+B4NwIHdaGxAGGv59nYRnGGDJ9LBk7alpS0US+J+bLLdQOOkJq4A==",
"license": "MIT",
"dependencies": {
"basic-auth": "^2.0.1",
"chalk": "^4.1.2",
"corser": "^2.0.1",
"he": "^1.2.0",
"html-encoding-sniffer": "^3.0.0",
"http-proxy": "^1.18.1",
"mime": "^1.6.0",
"minimist": "^1.2.6",
"opener": "^1.5.1",
"portfinder": "^1.0.28",
"secure-compare": "3.0.1",
"union": "~0.5.0",
"url-join": "^4.0.1"
},
"bin": {
"http-server": "bin/http-server"
},
"engines": {
"node": ">=12"
}
},
"node_modules/http-server/node_modules/mime": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
"integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
"license": "MIT",
"bin": {
"mime": "cli.js"
},
"engines": {
"node": ">=4"
}
},
"node_modules/https-proxy-agent": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz",
@ -1609,6 +1781,18 @@
"node": ">= 6"
}
},
"node_modules/iconv-lite": {
"version": "0.6.3",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
"integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
"license": "MIT",
"dependencies": {
"safer-buffer": ">= 2.1.2 < 3.0.0"
},
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/is-arrayish": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz",
@ -1746,6 +1930,15 @@
"node": ">=18.0.0"
}
},
"node_modules/minimist": {
"version": "1.2.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
"integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
"license": "MIT",
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/ms": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
@ -1826,6 +2019,15 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/opener": {
"version": "1.5.2",
"resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz",
"integrity": "sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==",
"license": "(WTFPL OR MIT)",
"bin": {
"opener": "bin/opener-bin.js"
}
},
"node_modules/path-to-regexp": {
"version": "6.3.0",
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.3.0.tgz",
@ -1840,6 +2042,19 @@
"dev": true,
"license": "MIT"
},
"node_modules/portfinder": {
"version": "1.0.37",
"resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.37.tgz",
"integrity": "sha512-yuGIEjDAYnnOex9ddMnKZEMFE0CcGo6zbfzDklkmT1m5z734ss6JMzN9rNB3+RR7iS+F10D4/BVIaXOyh8PQKw==",
"license": "MIT",
"dependencies": {
"async": "^3.2.6",
"debug": "^4.3.6"
},
"engines": {
"node": ">= 10.12"
}
},
"node_modules/printable-characters": {
"version": "1.0.42",
"resolved": "https://registry.npmjs.org/printable-characters/-/printable-characters-1.0.42.tgz",
@ -1862,6 +2077,12 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/requires-port": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz",
"integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==",
"license": "MIT"
},
"node_modules/safe-buffer": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
@ -1882,6 +2103,18 @@
],
"license": "MIT"
},
"node_modules/safer-buffer": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
"license": "MIT"
},
"node_modules/secure-compare": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/secure-compare/-/secure-compare-3.0.1.tgz",
"integrity": "sha512-AckIIV90rPDcBcglUwXPF3kg0P0qmPsPXAj6BBEENQE1p5yA1xfmDJzfi1Tappj37Pv2mVbKpL3Z1T+Nn7k1Qw==",
"license": "MIT"
},
"node_modules/semver": {
"version": "7.7.2",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz",
@ -2055,6 +2288,18 @@
"npm": ">=6"
}
},
"node_modules/supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"license": "MIT",
"dependencies": {
"has-flag": "^4.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/tr46": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
@ -2103,6 +2348,23 @@
"ufo": "^1.6.1"
}
},
"node_modules/union": {
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/union/-/union-0.5.0.tgz",
"integrity": "sha512-N6uOhuW6zO95P3Mel2I2zMsbsanvvtgn6jVqJv4vbVcz/JN0OkL9suomjQGmWtxJQXOCqUJvquc1sMeNz/IwlA==",
"dependencies": {
"qs": "^6.4.0"
},
"engines": {
"node": ">= 0.8.0"
}
},
"node_modules/url-join": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/url-join/-/url-join-4.0.1.tgz",
"integrity": "sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA==",
"license": "MIT"
},
"node_modules/url-template": {
"version": "2.0.8",
"resolved": "https://registry.npmjs.org/url-template/-/url-template-2.0.8.tgz",
@ -2128,6 +2390,18 @@
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==",
"license": "BSD-2-Clause"
},
"node_modules/whatwg-encoding": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz",
"integrity": "sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==",
"license": "MIT",
"dependencies": {
"iconv-lite": "0.6.3"
},
"engines": {
"node": ">=12"
}
},
"node_modules/whatwg-url": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",

View File

@ -9,7 +9,8 @@
"@cloudflare/workers-types": "^4.20250610.0",
"@google-cloud/local-auth": "^2.1.0",
"googleapis": "^105.0.0",
"hono": "^4.7.11"
"hono": "^4.7.11",
"http-server": "^14.1.1"
},
"devDependencies": {
"wrangler": "^4.4.0"

View File

@ -103,23 +103,25 @@
<label for="site-select" class="form-label">网盘名称</label>
<select id="site-select" class="form-select">
<!-- <option value="onedrive_pr" selected>OneDrive 个人账户</option>-->
<option value="onedrive_go">OneDrive 企业版本</option>
<option value="onedrive_go" selected>OneDrive 企业版本</option>
<option value="onedrive_cn">OneDrive 世纪互联</option>
<option value="onedrive_us">OneDrive 美国版本</option>
<option value="onedrive_de">OneDrive 德国版本</option>
<option value="alicloud_qr">阿里网盘 扫码登录</option>
<option value="baiduyun_go">百度网盘 验证登录</option>
<option value="115cloud_go">115 网盘 验证登录</option>
<option value="123cloud_go">123 网盘 直接登录</option>
<option value="googleui_go">Google Drive Team</option>
</select>
</div>
<div class="mb-3" style="margin-top: 15px">
<input type="checkbox" id="use-openlist-key" class="form-check-input">
<label for="use-openlist-key" class="form-check-label">使用 OpenList 提供的API</label>
<input type="checkbox" id="server_use" class="form-check-input">
<label for="server_use" class="form-check-label">使用 OpenList 提供的API</label>
</div>
<div class="mb-3">
<label for="client-id" class="form-label">客户端 ID</label>
<label for="client-id" class="form-label">客户端ID</label>
<input type="text" id="client-id" class="form-control">
</div>
@ -162,7 +164,7 @@
target="_blank">OpenListTeam</a>
</p>
</div>
</div>
</div>
</div>
<script>
@ -170,6 +172,7 @@
// 获取登录秘钥 #######################################################
async function getLogin() {
let server_use = document.getElementById("server_use").value;
let apps_uuid = document.getElementById("client-id").value;
let apps_keys = document.getElementById("app-secret").value;
let apps_type = document.getElementById("site-select").value;
@ -186,7 +189,8 @@
}
let apps_subs = apps_type.split("_")[0]
let post_urls = "/" + apps_subs + "/requests?client_uid=" + apps_uuid
+ "&client_key=" + apps_keys + "&apps_types=" + apps_type;
+ "&client_key=" + apps_keys + "&apps_types=" + apps_type
+ "&server_use=" + server_use
if (apps_subs === "baiduyun") post_urls += "&secret_key=" + secret_key
try {
const response = await fetch(post_urls, {
@ -196,9 +200,17 @@
const response_data = await response.json();
if (response.status === 200) {
if (apps_subs === "onedrive" || apps_subs === "115cloud"
|| apps_subs === "baiduyun") {
|| apps_subs === "baiduyun" || apps_subs === "googleui") {
window.location.href = response_data.text;
}
if (apps_subs === "123cloud") {
google(apps_uuid, apps_keys);
return;
}
if (apps_subs === "123cloud") {
document.getElementById("access-token").value = response_data.text;
return;
}
if (apps_type === "alicloud_qr") {
let sid = response_data.sid;
await Swal.fire({
@ -267,6 +279,7 @@
async function getToken() {
const strSearch = window.location.search;
const urlParams = new URLSearchParams(strSearch);
const server_use = urlParams.get("server_use");
const client_uid = urlParams.get("client_uid");
const secret_key = urlParams.get("secret_key");
const driver_txt = urlParams.get("driver_txt");
@ -275,11 +288,13 @@
const refresh_token = urlParams.get("refresh_token");
const message_err = urlParams.get("message_err");
document.getElementById("site-select").value = driver_txt;
if (!driver_txt || driver_txt === "")
document.getElementById("site-select").value = "onedrive_go";
document.getElementById("app-secret").value = client_key;
document.getElementById("client-id").value = client_uid;
document.getElementById("access-token").value = access_token;
document.getElementById("refresh-token").value = refresh_token;
if(secret_key)
if (secret_key)
document.getElementById("secret-key").value = secret_key;
// 获取select元素和输入框元素
const siteSelect = document.getElementById('site-select');
@ -296,9 +311,41 @@
}
});
document.getElementById('server_use').addEventListener('change', function () {
const clientIdInput = document.getElementById('client-id');
const appSecretInput = document.getElementById('app-secret');
const secretKeyInput = document.getElementById('secret-key');
const server_flag = document.getElementById('server_use');
if (siteSelect.value === "alicloud_qr" && server_flag.checked) {
server_flag.checked = false;
Swal.fire({
position: 'top',
icon: 'error',
title: '暂不支持',
html: "阿里云暂不支持",
showConfirmButton: true,
});
return;
}
if (this.checked) {
// 禁用输入框并清空内容
clientIdInput.disabled = true;
clientIdInput.value = '';
appSecretInput.disabled = true;
appSecretInput.value = '';
secretKeyInput.disabled = true;
secretKeyInput.value = '';
} else {
// 启用输入框
clientIdInput.disabled = false;
appSecretInput.disabled = false;
secretKeyInput.disabled = false;
}
});
// 页面加载时初始化回调地址
window.onload = function () {
siteSelect.dispatchEvent(new Event('change'));
};
if (message_err) {
@ -310,8 +357,6 @@
showConfirmButton: true,
});
}
}
//手动切换主题模式
@ -327,6 +372,7 @@
if (hour < 6 || hour >= 18) document.documentElement.setAttribute("data-theme", "dark");
getToken();
})();
getToken();
</script>
</body>

View File

@ -21,7 +21,7 @@ export async function oneLogin(c: Context) {
client_id: client_uid,
state: random_key,
response_type: 'code',
redirect_uri: 'https://' + c.env.MAIN_URLS + '/onedrive/callback'
redirect_uri: 'https://' + c.env.MAIN_URLS + '/115cloud/callback'
};
const urlWithParams = new URL(driver_map[0]);
Object.keys(params_all).forEach(key => {
@ -58,7 +58,7 @@ export async function oneToken(c: Context) {
params_all = {
client_id: client_uid,
client_secret: client_key,
redirect_uri: 'https://' + c.env.MAIN_URLS + '/onedrive/callback',
redirect_uri: 'https://' + c.env.MAIN_URLS + '/115cloud/callback',
code: login_data,
grant_type: 'authorization_code'
};

48
src/123ui.ts Normal file
View File

@ -0,0 +1,48 @@
import * as local from "hono/cookie";
import {Context} from "hono";
import {showErr} from "./error";
const driver_map: string[] = [
"https://open-api.123pan.com/api/v1/access_token",
"https://open-api.123pan.com/api/v1/access_token"
]
// 登录申请 ##############################################################################
export async function oneLogin(c: Context) {
const client_uid = c.req.query('client_uid');
const client_key = c.req.query('client_key');
const driver_txt = c.req.query('apps_types');
if (!driver_txt || !client_uid || !client_key)
return c.json({text: "参数缺少"}, 500);
// 请求参数 ==========================================================================
const params_all: Record<string, any> = {
client_id: client_uid,
clientSecret: client_key,
};
// 执行请求 ===========================================================================
try {
const paramsString = new URLSearchParams(params_all).toString();
const response: Response = await fetch(driver_map[0], {
method: 'POST', body: paramsString,
headers: {
'Platform': "open_platform",
'Content-Type': 'application/x-www-form-urlencoded'
},
});
const json: Record<string, any> = await response.json();
local.setCookie(c, 'client_uid', client_uid);
local.setCookie(c, 'client_key', client_key);
local.setCookie(c, 'driver_txt', driver_txt);
console.log(json);
return c.json({text: json.data.accessToken}, 200);
} catch (error) {
return c.json({text: error}, 500);
}
}
// 令牌申请 ##############################################################################
export async function oneToken(c: Context) {
return await oneLogin(c);
}

View File

@ -4,8 +4,8 @@ import {showErr} from "./error";
const driver_map: string[] = [
"https://passportapi.115.com/open/authorize",
"https://passportapi.115.com/open/authCodeToToken"
"https://accounts.google.com/o/oauth2/v2/auth",
"https://oauth2.googleapis.com/token"
]
// 登录申请 ##############################################################################
@ -15,27 +15,28 @@ export async function oneLogin(c: Context) {
const driver_txt = c.req.query('apps_types');
if (!driver_txt || !client_uid || !client_key)
return c.json({text: "参数缺少"}, 500);
const random_key = getRandomString(64);
const random_key = getRandomString(32);
// 请求参数 ==========================================================================
const params_all: Record<string, any> = {
client_id: client_uid,
state: random_key,
response_type: 'code',
redirect_uri: 'https://' + c.env.MAIN_URLS + '/onedrive/callback'
'client_id': client_uid,
'redirect_uri': 'https://' + c.env.MAIN_URLS + '/googleui/callback',
'scope': "https://www.googleapis.com/auth/drive",
'response_type': 'code',
'state': random_key,
'access_type': 'offline',
'prompt': 'consent'
};
local.setCookie(c, 'client_uid', client_uid);
local.setCookie(c, 'client_key', client_key);
local.setCookie(c, 'driver_txt', driver_txt);
local.setCookie(c, 'random_key', random_key);
const urlWithParams = new URL(driver_map[0]);
Object.keys(params_all).forEach(key => {
urlWithParams.searchParams.append(key, params_all[key]);
});
// 执行请求 ===========================================================================
try {
const response = await fetch(urlWithParams.href, {method: 'GET',});
local.setCookie(c, 'client_uid', client_uid);
local.setCookie(c, 'client_key', client_key);
local.setCookie(c, 'driver_txt', driver_txt);
local.setCookie(c, 'random_key', random_key);
console.log(response);
return c.json({text: response.url}, 200);
return c.json({text: urlWithParams}, 200);
} catch (error) {
return c.json({text: error}, 500);
}
@ -44,7 +45,7 @@ export async function oneLogin(c: Context) {
// 令牌申请 ##############################################################################
export async function oneToken(c: Context) {
let login_data, client_uid, client_key, random_key;
let driver_txt, client_url, params_all, random_uid;
let driver_txt, params_all, random_uid;
try { // 请求参数 ====================================================================
login_data = <string>c.req.query('code');
random_uid = <string>c.req.query('state');
@ -52,39 +53,37 @@ export async function oneToken(c: Context) {
client_key = <string>local.getCookie(c, 'client_key')
random_key = <string>local.getCookie(c, 'random_key')
driver_txt = local.getCookie(c, 'driver_txt')
// console.log(login_data, random_uid, client_uid, client_key, random_key, driver_txt)
if (!client_uid || !client_key || random_uid !== random_key || !client_uid || !client_key)
return c.redirect(showErr("Cookie无效", "", ""));
client_url = driver_map[1];
params_all = {
client_id: client_uid,
client_secret: client_key,
redirect_uri: 'https://' + c.env.MAIN_URLS + '/onedrive/callback',
code: login_data,
grant_type: 'authorization_code'
'client_id': client_uid,
'client_secret': client_key,
'code': login_data,
'grant_type': 'authorization_code',
'redirect_uri': 'https://' + c.env.MAIN_URLS + '/googleui/callback',
};
} catch (error) {
return c.redirect(showErr(<string>error, "", ""));
}
// console.log(login_data);
console.log(params_all);
// 执行请求 ===========================================================================
try {
const paramsString = new URLSearchParams(params_all).toString();
const response: Response = await fetch(client_url, {
const response: Response = await fetch(driver_map[1], {
method: 'POST', body: paramsString,
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
headers: {'Content-Type': 'application/x-www-form-urlencoded',},
});
local.deleteCookie(c, 'client_uid');
local.deleteCookie(c, 'client_key');
local.deleteCookie(c, 'random_key');
local.deleteCookie(c, 'driver_txt');
let json: Record<string, any> = await response.json();
if (json.state == 1) {
console.log(json);
if (json.token_type == "Bearer") {
return c.redirect(
`/?access_token=${json.data.access_token}`
+ `&refresh_token=${json.data.refresh_token}`
`/?access_token=${json.access_token}`
+ `&refresh_token=${json.refresh_token}`
+ `&client_uid=${client_uid}`
+ `&client_key=${client_key}`
+ `&driver_txt=${driver_txt}`

View File

@ -6,6 +6,7 @@ import * as local from "hono/cookie";
import * as oneui from './oneui';
import * as aliui from './aliui';
import * as ui115 from './115ui';
import * as ui123 from './123ui';
import * as baidu from './baidu';
import * as goapi from './goapi';
export type Bindings = {
@ -53,6 +54,16 @@ app.get('/115cloud/callback', async (c: Context) => {
return ui115.oneToken(c);
});
// 登录申请 ##############################################################################
app.get('/123cloud/requests', async (c: Context) => {
return ui123.oneLogin(c);
});
// 令牌申请 ##############################################################################
app.get('/123cloud/callback', async (c: Context) => {
return ui123.oneToken(c);
});
// 登录申请 ##############################################################################
app.get('/googleui/requests', async (c: Context) => {
return goapi.oneLogin(c);

View File

@ -1,15 +0,0 @@
{
"$schema": "node_modules/wrangler/config-schema.json",
"name": "cf-worker-api",
"main": "src/index.ts",
"compatibility_date": "2025-05-25",
"compatibility_flags": [
"nodejs_compat"
],
"vars": {
"MAIN_URLS": "api.oplist.org"
},
"site": {
"bucket": "./public"
},
}

27
wrangler.jsonc.example Normal file
View File

@ -0,0 +1,27 @@
{
"$schema": "node_modules/wrangler/config-schema.json",
"name": "cf-worker-api",
"main": "src/index.ts",
"compatibility_date": "2025-05-25",
"compatibility_flags": [
"nodejs_compat"
],
"vars": {
"MAIN_URLS": "api.oplist.org",
"onedrive_uid": "",
"onedrive_key": "",
"alicloud_uid": "",
"alicloud_key": "",
"baiduyun_uid": "",
"baiduyun_key": "",
"115cloud_uid": "",
"115cloud_key": "",
"123cloud_uid": "",
"123cloud_key": "",
"googleui_uid": "",
"googleui_key": ""
},
"site": {
"bucket": "./public"
}
}