From 270c226d2d880d68e626b980f899f81d9e673687 Mon Sep 17 00:00:00 2001 From: ruopeisun Date: Sat, 20 Nov 2021 11:43:37 +0800 Subject: [PATCH] add short URL support --- common.php | 4 ++++ conststr.php | 4 ++++ theme/classic.html | 38 +++++++++++++++++++++++++++++++++++++- 3 files changed, 45 insertions(+), 1 deletion(-) diff --git a/common.php b/common.php index 672438d..a9f4615 100644 --- a/common.php +++ b/common.php @@ -61,6 +61,8 @@ $EnvConfigs = [ 'public_path' => 0b111, 'fileConduitSize' => 0b110, 'fileConduitCacheTime' => 0b110, + + 'reurl_cc_api' => 0b010, //shortUrlSite_apiKey ]; $timezones = array( @@ -2923,6 +2925,8 @@ function render_list($path = '', $files = []) $tmp = splitfirst($html, ''); $html = $tmp[0] . '' . $authinfo . $tmp[1]; + //短链接apikey处理 + $html = str_replace('your_api_key_for_reurl_cc', strval(getConfig('reurl_cc_api')), $html); //if (isset($_SERVER['Set-Cookie'])) return output($html, $statusCode, [ 'Set-Cookie' => $_SERVER['Set-Cookie'], 'Content-Type' => 'text/html' ]); return output($html, $statusCode); } diff --git a/conststr.php b/conststr.php index 4b72019..4a9c0d6 100644 --- a/conststr.php +++ b/conststr.php @@ -115,6 +115,7 @@ $constStr = [ 'domainforproxy' => 'Will replace the https://xxxxx-my.sharepoint.com with this value.Add &Origindomain=xxxxx-my.sharepoint.com at last', 'public_path' => 'Show this Onedrive dir when through the long url of API Gateway.', 'sitename' => 'sitename', + 'reurl_cc_api' => 'the api_key of short URL site of reurl.cc', ], 'zh-cn' => [ 'admin' => '管理密码,不添加时不显示登录页面且无法登录。', @@ -145,6 +146,7 @@ $constStr = [ 'domainforproxy' => '会将https://xxxxx-my.sharepoint.com替换成这个值,在目标需要自己设置反代。会加上&Origindomain=原域名', 'public_path' => '使用API长链接访问时,显示网盘文件的路径,不设置时默认为根目录。', 'sitename' => '网站的名称', + 'reurl_cc_api' => 'reurl.cc 短链接网站的api key', ], 'zh-tw' => [ 'admin' => '管理密碼,不設定密碼將不顯示登入頁面且無法登入。', @@ -170,6 +172,7 @@ $constStr = [ 'domainforproxy' => '會將https://xxxxx-my.sharepoint.com取代成這個值,在目標需要自己設定反代。會加上&Origindomain=原域名', 'public_path' => '使用API長連結訪問時,顯示網路硬碟檔案的路徑,不設定時預設為根目錄。', 'sitename' => '網站的名稱', + 'reurl_cc_api' => 'reurl.cc 短連結網站的api key', ], 'ja' => [ 'admin' => 'パスワードを管理する、追加しない場合、ログインページは表示されず、ログインできません。', @@ -195,6 +198,7 @@ $constStr = [ 'domainforproxy' => '会将https://xxxy-my.sharepoint.comこの値に代えて、目標には自分で反世代を設定する必要があります。に加えて&Originndomain=元のドメイン名', 'public_path' => 'APIのロングリンクアクセスを使用する場合、ネットワークディスクファイルのパスが表示されますが、設定されていない場合はデフォルトでルートディレクトリになり。', 'sitename' => 'ウェブサイト名', + 'reurl_cc_api' => 'reurl.cc ショートリンクサイトのapi key', ], 'ko-kr' => [ 'admin' => '비밀번호를 관리하고 로그인 페이지를 표시하지 않으며 추가하지 않으면 로그인 할 수 없습니다.', diff --git a/theme/classic.html b/theme/classic.html index 17b04a9..d1c4590 100644 --- a/theme/classic.html +++ b/theme/classic.html @@ -150,7 +150,7 @@
-

/

+

/         

@@ -491,6 +491,42 @@