From 31e5325cc66dd74eb2e566c9ef1b7719ce717d6f Mon Sep 17 00:00:00 2001 From: kx_guo Date: Fri, 18 Sep 2026 13:46:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AE=A1=E6=A0=B8=E5=85=A5?= =?UTF-8?q?=E5=8F=A3=E6=9D=83=E9=99=90=E5=88=B7=E6=96=B0=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../assistant/AssistantComposer.vue | 36 +++++++++++-------- src/pages/RiskAssistantPage.vue | 1 + src/router/index.ts | 4 +++ 3 files changed, 26 insertions(+), 15 deletions(-) diff --git a/src/components/assistant/AssistantComposer.vue b/src/components/assistant/AssistantComposer.vue index b84b7ac..386de18 100644 --- a/src/components/assistant/AssistantComposer.vue +++ b/src/components/assistant/AssistantComposer.vue @@ -15,7 +15,12 @@ import { ref } from "vue"; import { featureFlags } from "@/config/features"; -defineProps<{ modelValue: string; loading: boolean; canUpload: boolean }>(); +const props = defineProps<{ + modelValue: string; + loading: boolean; + canUpload: boolean; + canReview: boolean; +}>(); const emit = defineEmits<{ "update:modelValue": [value: string]; @@ -153,21 +158,22 @@ const functions: Array<{
- + + + 新 + {{ item.title }}{{ item.description }} + +
diff --git a/src/pages/RiskAssistantPage.vue b/src/pages/RiskAssistantPage.vue index bdacaec..74f0c87 100644 --- a/src/pages/RiskAssistantPage.vue +++ b/src/pages/RiskAssistantPage.vue @@ -681,6 +681,7 @@ async function scrollToBottom(behavior: "smooth" | "auto" = "smooth") { v-model="prompt" :loading="loading" :can-upload="auth.hasPermission('risk_item.submit')" + :can-review="auth.hasPermission('risk_item.review')" @submit="submit" @select="usePrompt" @tool="openTool" diff --git a/src/router/index.ts b/src/router/index.ts index b456c47..de3cd28 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -24,6 +24,10 @@ router.beforeEach(async (to) => { return { name: "login", query: { redirect: to.fullPath } }; } const permission = to.meta.permission; + // Refresh the permission snapshot before protected navigation. A role or + // permission changed directly in the database must take effect without + // requiring the user to clear the old browser session first. + if (typeof permission === "string" && auth.token) await auth.restore(); if (typeof permission === "string" && !auth.hasPermission(permission)) return { name: "assessment" }; return true;