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