mirror of
https://github.com/Kuingsmile/PicList.git
synced 2025-01-23 14:48:13 -05:00
parent
6a94503172
commit
58486a3997
@ -122,9 +122,12 @@ export const generateShortUrl = async (url: string) => {
|
||||
console.log(e)
|
||||
}
|
||||
} else if (server === 'yourls') {
|
||||
const domain = db.get('settings.yourlsDomain') || ''
|
||||
let domain = db.get('settings.yourlsDomain') || ''
|
||||
const signature = db.get('settings.yourlsSignature') || ''
|
||||
if (domain && signature) {
|
||||
if (!/^https?:\/\//.test(domain)) {
|
||||
domain = `http://${domain}`
|
||||
}
|
||||
try {
|
||||
const res = await axios.get(`${domain}/yourls-api.php?signature=${signature}&action=shorturl&format=json&url=${url}`)
|
||||
if (res.data.shorturl) {
|
||||
|
Loading…
Reference in New Issue
Block a user