Skip to content

Commit ea301b8

Browse files
committed
修复HomePage硬编码localhost,使用SHORT_BASE
1 parent b6ff302 commit ea301b8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

web/src/pages/HomePage.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ import axios from 'axios'
163163
import LoadingSpinner from '../components/LoadingSpinner.vue'
164164
import QrcodeVue from 'qrcode.vue'
165165
import Favicon from '../components/Favicon.vue'
166+
import { SHORT_BASE } from '/src/composables/shortBase'
166167
167168
const api = axios
168169
@@ -352,9 +353,9 @@ export default {
352353
buildDisplayShortUrl(code) {
353354
if (!code) return ''
354355
try {
355-
return new URL('/' + encodeURIComponent(String(code)), 'http://localhost:8080').href
356+
return new URL('/' + encodeURIComponent(String(code)), SHORT_BASE).href
356357
} catch {
357-
return 'http://localhost:8080/' + encodeURIComponent(String(code))
358+
return SHORT_BASE + '/' + encodeURIComponent(String(code))
358359
}
359360
},
360361
displayShortUrl(item) {

0 commit comments

Comments
 (0)