Files
PicList/src/renderer/apis/smms.ts
2023-02-20 10:25:59 +08:00

24 lines
548 B
TypeScript

import axios from 'axios'
export default class SmmsApi {
static async delete (configMap: IStringKeyMap): Promise<boolean> {
const { hash, config: { token } } = configMap
if (!hash || !token) {
return false
} else {
const res = await axios.get(
`https://smms.app/api/v2/delete/${hash}`, {
headers: {
Authorization: token
},
params: {
hash,
format: 'json'
},
timeout: 30000
})
return res.status === 200
}
}
}