refactor: portal admin routes to management
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user