use absolute path for all routes

This commit is contained in:
RockYang
2023-09-07 10:27:18 +08:00
parent 3b26735998
commit f943669e18
9 changed files with 27 additions and 19 deletions

View File

@@ -55,7 +55,7 @@ const username = ref(process.env.VUE_APP_ADMIN_USER);
const password = ref(process.env.VUE_APP_ADMIN_PASS);
checkAdminSession().then(() => {
router.push("admin")
router.push("/admin")
}).catch(() => {
})
onMounted(() => {
@@ -76,7 +76,7 @@ const login = function () {
httpPost('/api/admin/login', {username: username.value.trim(), password: password.value.trim()}).then(res => {
setAdminToken(res.data)
router.push("admin")
router.push("/admin")
}).catch((e) => {
ElMessage.error('登录失败,' + e.message)
})