Skip to content

Commit

Permalink
index-multiple-accounts.js + credits
Browse files Browse the repository at this point in the history
  • Loading branch information
alx-xlx committed Jul 3, 2020
1 parent 2420bf5 commit ceb6937
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 15 deletions.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ Combining the power of [Cloudflare Workers](https://workers.cloudflare.com/) and
# Versions


## 1. [Aicirou/goindex-theme-acrou](https://github.com/Aicirou/goindex-theme-acrou)

## 1. [Aicirou/goindex-theme](https://github.com/Aicirou/goindex-theme-acrou)

Worker Script (Dark Mode) : [index.js](https://github.com/alx-xlx/goindex/blob/2.0.5-darkmode-0.1/goindex-acrou/go2index/index.js)

Worker Script (Multiple Google Accounts) : [index-multiple-accounts.js](https://github.com/alx-xlx/goindex/blob/master/goindex-acrou/go2index/index-multiple-accounts.js)

Demo - [goindex.teamsdrives.workers.dev](https://goindex.teamsdrives.workers.dev)

Copy the [index.js](https://github.com/alx-xlx/goindex/blob/2.0.5-darkmode-0.1/goindex-acrou/go2index/index.js) script to [workers.dev](https://workers.cloudflare.com/) and edit `client_id`, `client_secret`, `refresh_token` with yours
Expand Down Expand Up @@ -178,3 +180,11 @@ https://www.base64-image.de/

## About
Cloudflare Workers allow you to write JavaScript which runs on all of Cloudflare's 150+ global data centers.

## Credits - Original Authors

goindex-theme-acrou - [Aicirou](https://github.com/Aicirou/goindex-theme-acrou)

GDIndex - [maple3142](https://github.com/maple3142/GDIndex)

goindex - [donwa](https://github.com/donwa/goindex)
27 changes: 13 additions & 14 deletions goindex-acrou/go2index/index-multiple-accounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,34 +48,34 @@ var authConfig = {
{
id: "root",
name: "Drive 1",
user: "admin",
pass: "1234",
protect_file_link: true,
user: "",
pass: "",
protect_file_link: false,
client_id: "",
client_secret: "",
refresh_token: ""
},
{
id: "root",
name: "Drive 2",
user: "",
pass: "",
protect_file_link: false,
user: "1234",
pass: "1234",
protect_file_link: true,
client_id: "",
client_secret: "",
refresh_token: ""
},
{
id: "",
name: "folder1",
name: "Drive 3",
pass: "",
},
]

var themeOptions = {
cdn: "https://cdn.jsdelivr.net/gh/Aicirou/goindex-theme-acrou",
// 主题版本号
version: "2.0.5",
cdn: "https://cdn.jsdelivr.net/gh/alx-xlx/goindex",
// 主题版本号
version: "2.0.5-darkmode-0.1",
//可选默认系统语言:en/zh-chs/zh-cht
languages: "en",
render: {
Expand Down Expand Up @@ -154,7 +154,7 @@ var authConfig = {
<meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=no"/>
<title>${authConfig.siteName}</title>
<style>
@import url(${themeOptions.cdn}@${themeOptions.version}/dist/style.min.css);
@import url(${themeOptions.cdn}@${themeOptions.version}/goindex-acrou/dist/style.min.css);
</style>
<script>
window.gdconfig = JSON.parse('${JSON.stringify({
Expand All @@ -173,7 +173,7 @@ var authConfig = {
<div id="app"></div>
<script src="${themeOptions.cdn}@${
themeOptions.version
}/dist/app.min.js"></script>
}/goindex-acrou/dist/app.min.js"></script>
</body>
</html>
`;
Expand Down Expand Up @@ -404,9 +404,8 @@ var authConfig = {
// 每个盘对应一个order,对应一个gd实例
this.order = order;
this.accounts = accounts[order];
console.log(this.accounts);
this.protect_file_link = this.protect_file_link || false;
this.url_path_prefix = `/${order}:/`;
this.url_path_prefix = `/${order}:`;
this.authConfig = authConfig;
// TODO: 这些缓存的失效刷新策略,后期可以制定一下
// path id
Expand Down

0 comments on commit ceb6937

Please sign in to comment.