mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-05-06 20:42:57 +08:00
✨ Feature(custom): migrate sm.ms to s.ee
This commit is contained in:
4
FAQ.md
4
FAQ.md
@@ -24,7 +24,7 @@ PicList 添加的所有新功能未影响 PicGo 的原有功能,因此你可
|
||||
- 腾讯云 COS
|
||||
- 七牛云 Kodo
|
||||
- 又拍云
|
||||
- SM.MS
|
||||
- S.EE
|
||||
- Imgur
|
||||
- GitHub
|
||||
- WebDav
|
||||
@@ -49,7 +49,7 @@ PicList本体支持了如下图床:
|
||||
- `腾讯云 COS`
|
||||
- `又拍云`
|
||||
- `GitHub`
|
||||
- `SM.MS`
|
||||
- `S.EE`
|
||||
- `阿里云 OSS`
|
||||
- `Imgur`
|
||||
- `Webdav`
|
||||
|
||||
@@ -24,7 +24,7 @@ Currently, the supported image hosting platforms are:
|
||||
- Tencent Cloud COS
|
||||
- Qiniu Cloud Kodo
|
||||
- Upyun
|
||||
- SM.MS
|
||||
- S.EE
|
||||
- Imgur
|
||||
- GitHub
|
||||
- Webdav
|
||||
@@ -49,7 +49,7 @@ PicList itself supports the following image hosting platforms:
|
||||
- Tencent Cloud COS
|
||||
- Upyun
|
||||
- GitHub
|
||||
- SM.MS
|
||||
- S.EE
|
||||
- Aliyun OSS
|
||||
- Imgur
|
||||
- Webdav
|
||||
|
||||
@@ -145,7 +145,7 @@ PicList supports a wide range of storage providers.
|
||||
| **Aliyun OSS** | ✅ | ✅ |
|
||||
| **Tencent COS** | ✅ | ✅ |
|
||||
| **GitHub / Gitee** | ✅ | ✅ |
|
||||
| **SM.MS / Imgur** | ✅ | ✅ |
|
||||
| **S.EE / Imgur** | ✅ | ✅ |
|
||||
| **WebDAV / SFTP** | ✅ | ✅ |
|
||||
| **Local File System** | ✅ | ✅ |
|
||||
| **Lsky Pro / Doge Cloud** | ✅ | ✅ |
|
||||
|
||||
@@ -145,7 +145,7 @@ PicList 支持广泛的存储提供商。
|
||||
| **阿里云 OSS** | ✅ | ✅ |
|
||||
| **腾讯云 COS** | ✅ | ✅ |
|
||||
| **GitHub / Gitee** | ✅ | ✅ |
|
||||
| **SM.MS / Imgur** | ✅ | ✅ |
|
||||
| **S.EE / Imgur** | ✅ | ✅ |
|
||||
| **WebDAV / SFTP** | ✅ | ✅ |
|
||||
| **本地文件系统** | ✅ | ✅ |
|
||||
| **兰空图床 / 多吉云** | ✅ | ✅ |
|
||||
|
||||
@@ -8,7 +8,7 @@ interface IConfigMap {
|
||||
}
|
||||
|
||||
export default class SmmsApi {
|
||||
static readonly #baseUrl = 'https://smms.app/api/v2'
|
||||
static readonly #baseUrl = 'https://s.ee/api/v1'
|
||||
|
||||
static async delete(configMap: IConfigMap): Promise<boolean> {
|
||||
const { hash, config } = configMap
|
||||
@@ -20,7 +20,7 @@ export default class SmmsApi {
|
||||
const { token } = config
|
||||
|
||||
try {
|
||||
const response: AxiosResponse = await axios.get(`${SmmsApi.#baseUrl}/delete/${hash}`, {
|
||||
const response: AxiosResponse = await axios.get(`${SmmsApi.#baseUrl}/file/delete/${hash}`, {
|
||||
headers: {
|
||||
Authorization: token,
|
||||
},
|
||||
|
||||
@@ -14,7 +14,7 @@ import { isImage } from '~/utils/common'
|
||||
import { commonTaskStatus, IWindowList } from '~/utils/enum'
|
||||
|
||||
class SmmsApi {
|
||||
baseUrl = 'https://smms.app/api/v2'
|
||||
baseUrl = 'https://s.ee/api/v1'
|
||||
token: string
|
||||
axiosInstance: AxiosInstance
|
||||
logger: ManageLogger
|
||||
@@ -43,7 +43,7 @@ class SmmsApi {
|
||||
key: item.path,
|
||||
fileName: item.filename,
|
||||
fileSize: item.size,
|
||||
formatedTime: new Date(item.created_at).toLocaleString(),
|
||||
formatedTime: new Date(item.created_at * 1000).toLocaleString(),
|
||||
isDir: false,
|
||||
checked: false,
|
||||
match: false,
|
||||
@@ -71,17 +71,14 @@ class SmmsApi {
|
||||
finished: false,
|
||||
}
|
||||
do {
|
||||
res = await this.axiosInstance('/upload_history', {
|
||||
res = await this.axiosInstance('/files', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
},
|
||||
params: {
|
||||
page: marker,
|
||||
},
|
||||
})
|
||||
if (res && res.status === 200 && res.data && res.data.success) {
|
||||
if (res.data.Count === 0) {
|
||||
if (res.data.data.length === 0) {
|
||||
result.success = true
|
||||
result.finished = true
|
||||
window?.webContents.send('refreshFileTransferList', result)
|
||||
@@ -129,18 +126,15 @@ class SmmsApi {
|
||||
nextMarker: '',
|
||||
success: false,
|
||||
}
|
||||
const res = await this.axiosInstance('/upload_history', {
|
||||
const res = await this.axiosInstance('/files', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
},
|
||||
params: {
|
||||
page: currentPage,
|
||||
},
|
||||
})
|
||||
if (res?.status !== 200 || !res?.data?.success) return result
|
||||
|
||||
if (res.data.Count === 0) return { ...result, success: true }
|
||||
if (res.data.data.length === 0) return { ...result, success: true }
|
||||
|
||||
res.data.data.forEach((item: any) => {
|
||||
result.fullList.push(this.formatFile(item))
|
||||
@@ -162,7 +156,7 @@ class SmmsApi {
|
||||
* }
|
||||
*/
|
||||
async deleteBucketFile({ DeleteHash }: IStringKeyMap): Promise<boolean> {
|
||||
const res = await this.axiosInstance(`/delete/${DeleteHash}`, {
|
||||
const res = await this.axiosInstance(`/file/delete/${DeleteHash}`, {
|
||||
method: 'GET',
|
||||
params: {
|
||||
hash: DeleteHash,
|
||||
@@ -203,7 +197,7 @@ class SmmsApi {
|
||||
})
|
||||
const headers = form.getHeaders()
|
||||
headers.Authorization = this.token
|
||||
const url = `${this.baseUrl}/upload`
|
||||
const url = `${this.baseUrl}/file/upload`
|
||||
gotUpload(instance, url, 'POST', form, headers, id, this.logger)
|
||||
}
|
||||
return true
|
||||
|
||||
@@ -466,9 +466,9 @@
|
||||
"webPathTips": "Used to assemble the public URL"
|
||||
},
|
||||
"smms": {
|
||||
"explain": "For mainland China, please use the backup domain https://smms.app and avoid sending too many requests in a short time",
|
||||
"tokenDesc": "SM.MS Token, available in your SM.MS profile",
|
||||
"tokenPlaceholder": "Please enter SM.MS Token"
|
||||
"explain": "Migrated to https://s.ee, please use the new API token",
|
||||
"tokenDesc": "S.EE Token, available in your S.EE profile",
|
||||
"tokenPlaceholder": "Please enter S.EE Token"
|
||||
},
|
||||
"specialDesc": "Special configuration",
|
||||
"specialPlaceholder": "Please enter special configuration",
|
||||
|
||||
@@ -466,9 +466,9 @@
|
||||
"webPathTips": "用于拼接访问网址"
|
||||
},
|
||||
"smms": {
|
||||
"explain": "大陆地区请访问备用域名https://smms.app,不要短时大量请求",
|
||||
"tokenDesc": "SM.MS Token, 可在 SM.MS 个人中心获取",
|
||||
"tokenPlaceholder": "请输入 SM.MS Token"
|
||||
"explain": "已迁移至https://s.ee,请使用新的API token",
|
||||
"tokenDesc": "S.EE Token, 可在 S.EE 个人中心获取",
|
||||
"tokenPlaceholder": "请输入 S.EE Token"
|
||||
},
|
||||
"specialDesc": "特殊配置",
|
||||
"specialPlaceholder": "请输入特殊配置",
|
||||
|
||||
@@ -466,9 +466,9 @@
|
||||
"webPathTips": "用於拼接對外存取網址"
|
||||
},
|
||||
"smms": {
|
||||
"explain": "中國大陸地區請訪問備用網域 https://smms.app,請勿在短時間內大量請求",
|
||||
"tokenDesc": "SM.MS Token,可在 SM.MS 個人中心取得",
|
||||
"tokenPlaceholder": "請輸入 SM.MS Token"
|
||||
"explain": "已遷移至 https://s.ee,請使用新的 API token",
|
||||
"tokenDesc": "S.EE Token,可在 S.EE 個人中心取得",
|
||||
"tokenPlaceholder": "請輸入 S.EE Token"
|
||||
},
|
||||
"specialDesc": "特殊設定",
|
||||
"specialPlaceholder": "請輸入特殊設定",
|
||||
|
||||
@@ -78,7 +78,7 @@ const isAutoCustomUrlTooltip = t('pages.manage.constant.isAutoCustomUrlTip')
|
||||
|
||||
export const supportedPicBedList: IStringKeyMap = {
|
||||
smms: {
|
||||
name: 'SM.MS',
|
||||
name: 'S.EE',
|
||||
icon: 'smms',
|
||||
configOptions: {
|
||||
alias: {
|
||||
|
||||
Reference in New Issue
Block a user