mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-08-05 13:18:35 +08:00
24 lines
548 B
TypeScript
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
|
|
}
|
|
}
|
|
}
|