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