Skip to content

Commit 3a1d7cd

Browse files
author
Taois
committed
feat: 增加FTP和WebDav协议支持
1 parent 1ce567b commit 3a1d7cd

File tree

14 files changed

+2097
-1
lines changed

14 files changed

+2097
-1
lines changed

config/map.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
webdav[盘]@@?render=1&type=url&params=../json/webdav.json@@本地文件[盘]
1+
webdav[盘]@@?render=1&type=url&params=../json/webdav.json@@WebDav[盘]
2+
ftp[盘]@@?render=1&type=url&params=../json/ftp.json@@FTP[盘]
23
哔哩收藏[官]@@?render=1&type=url&params=../json/哔哩收藏.json@@哔哩收藏[官]
34
我的哔哩[官]@@?render=1&type=url&params=../json/哔哩教育.json@@哔哩教育[官]
45
我的哔哩[官]@@?render=1&type=url&params=../json/哔哩少儿.json@@哔哩少儿[官]

controllers/api.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ export default (fastify, options, done) => {
133133
const imageApi = `${protocol}://${hostname}/image`;
134134
const mediaProxyUrl = `${protocol}://${hostname}/mediaProxy`;
135135
const webdavProxyUrl = `${protocol}://${hostname}/webdav/`;
136+
const ftpProxyUrl = `${protocol}://${hostname}/ftp/`;
136137
const hostUrl = `${hostname.split(':')[0]}`;
137138
const fServer = fastify.server;
138139

@@ -157,6 +158,7 @@ export default (fastify, options, done) => {
157158
imageApi,
158159
mediaProxyUrl,
159160
webdavProxyUrl,
161+
ftpProxyUrl,
160162
hostUrl,
161163
hostname,
162164
fServer,
@@ -411,6 +413,7 @@ export default (fastify, options, done) => {
411413
const imageApi = `${protocol}://${hostname}/image`;
412414
const mediaProxyUrl = `${protocol}://${hostname}/mediaProxy`;
413415
const webdavProxyUrl = `${protocol}://${hostname}/webdav/`;
416+
const ftpProxyUrl = `${protocol}://${hostname}/ftp/`;
414417
const hostUrl = `${hostname.split(':')[0]}`;
415418
const fServer = fastify.server;
416419

@@ -436,6 +439,7 @@ export default (fastify, options, done) => {
436439
imageApi,
437440
mediaProxyUrl,
438441
webdavProxyUrl,
442+
ftpProxyUrl,
439443
hostUrl,
440444
hostname,
441445
fServer,
@@ -552,6 +556,7 @@ export default (fastify, options, done) => {
552556
const imageApi = `${protocol}://${hostname}/image`;
553557
const mediaProxyUrl = `${protocol}://${hostname}/mediaProxy`;
554558
const webdavProxyUrl = `${protocol}://${hostname}/webdav/`;
559+
const ftpProxyUrl = `${protocol}://${hostname}/ftp/`;
555560
const hostUrl = `${hostname.split(':')[0]}`;
556561
const fServer = fastify.server;
557562

@@ -577,6 +582,7 @@ export default (fastify, options, done) => {
577582
imageApi,
578583
mediaProxyUrl,
579584
webdavProxyUrl,
585+
ftpProxyUrl,
580586
hostUrl,
581587
hostname,
582588
getProxyUrl,

0 commit comments

Comments
 (0)