🚧 WIP: add doge cloud support

This commit is contained in:
萌萌哒赫萝 2023-08-21 07:37:51 -07:00
parent dfc4b06dd8
commit 10da6a92d1
3 changed files with 9 additions and 0 deletions

View File

@ -73,6 +73,7 @@
"pinia-plugin-persistedstate": "^3.1.0", "pinia-plugin-persistedstate": "^3.1.0",
"qiniu": "^7.9.0", "qiniu": "^7.9.0",
"qrcode.vue": "^3.4.0", "qrcode.vue": "^3.4.0",
"querystring": "^0.2.1",
"shell-path": "2.1.0", "shell-path": "2.1.0",
"upyun": "^3.4.6", "upyun": "^3.4.6",
"uuid": "^9.0.0", "uuid": "^9.0.0",

View File

@ -325,6 +325,9 @@ class SftpApi {
let result = false let result = false
try { try {
await this.connectClient() await this.connectClient()
if (key.replace(/^\/+/, '') === '' || key.includes('*')) {
throw new Error('禁止删除')
}
const res = await this.ctx.execCommand(`rm -rf "/${key.replace(/^\/+/, '')}"`) const res = await this.ctx.execCommand(`rm -rf "/${key.replace(/^\/+/, '')}"`)
this.ctx.close() this.ctx.close()
result = this.isRequestSuccess(res.code) result = this.isRequestSuccess(res.code)

View File

@ -11601,6 +11601,11 @@ query-string@^5.0.1:
object-assign "^4.1.0" object-assign "^4.1.0"
strict-uri-encode "^1.0.0" strict-uri-encode "^1.0.0"
querystring@^0.2.1:
version "0.2.1"
resolved "https://registry.npmjs.org/querystring/-/querystring-0.2.1.tgz#40d77615bb09d16902a85c3e38aa8b5ed761c2dd"
integrity sha512-wkvS7mL/JMugcup3/rMitHmd9ecIGd2lhFhK9N3UUQ450h66d1r3Y9nvXzQAW1Lq+wyx61k/1pfKS5KuKiyEbg==
querystringify@^2.1.1: querystringify@^2.1.1:
version "2.2.0" version "2.2.0"
resolved "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6" resolved "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6"