refactor: portal admin routes to management

This commit is contained in:
2025-12-25 14:33:23 +08:00
parent 6542c71ec0
commit 20f9b3cf1f
3 changed files with 20 additions and 21 deletions

View File

@@ -105,13 +105,13 @@ async function submit() {
detail: `内容已进入审核ID: ${payload?.content?.id || '-'})`,
life: 2500
});
await router.push('/admin/contents');
await router.push('/management/contents');
} catch (err) {
const status = err?.status;
const msg = String(err?.payload?.message || err?.payload?.error || err?.message || '').trim();
if (status === 401) {
toast.add({ severity: 'warn', summary: '请先登录', detail: '登录后再提交发布', life: 2500 });
const redirect = typeof route.fullPath === 'string' ? route.fullPath : '/admin/contents/new';
const redirect = typeof route.fullPath === 'string' ? route.fullPath : '/management/contents/new';
await router.push(`/auth/login?redirect=${encodeURIComponent(redirect)}`);
return;
}
@@ -123,7 +123,7 @@ async function submit() {
onMounted(async () => {
if (!isLoggedIn.value) {
const redirect = typeof route.fullPath === 'string' ? route.fullPath : '/admin/contents/new';
const redirect = typeof route.fullPath === 'string' ? route.fullPath : '/management/contents/new';
await router.push(`/auth/login?redirect=${encodeURIComponent(redirect)}`);
}
});
@@ -206,4 +206,3 @@ onMounted(async () => {
</div>
</div>
</template>