权限问题修改

This commit is contained in:
2026-08-31 10:49:42 +08:00
parent 5ecd8ac95c
commit 2c89967af0
3 changed files with 10 additions and 5 deletions
+1 -1
View File
@@ -130,7 +130,6 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
async function loginByToken(loginToken: Api.Auth.LoginToken) { async function loginByToken(loginToken: Api.Auth.LoginToken) {
// 1. stored in the localStorage, the later requests need it in headers // 1. stored in the localStorage, the later requests need it in headers
localStg.set('userInfo', loginToken);
localStg.set('token', loginToken.token); localStg.set('token', loginToken.token);
// 2. get user info // 2. get user info
@@ -149,6 +148,7 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
const { data: info, error } = await fetchGetUserInfo(); const { data: info, error } = await fetchGetUserInfo();
if (!error) { if (!error) {
localStg.set('userInfo', info);
// update store // update store
Object.assign(userInfo, info); Object.assign(userInfo, info);
+1 -1
View File
@@ -232,7 +232,7 @@ export const useRouteStore = defineStore(SetupStoreId.Route, () => {
/** Init static auth route */ /** Init static auth route */
function initStaticAuthRoute() { function initStaticAuthRoute() {
const { authRoutes: staticAuthRoutes } = createStaticRoutes(); const { authRoutes: staticAuthRoutes } = createStaticRoutes();
const filteredRoutes = filterRoutesByPaths(staticAuthRoutes, localStg.get('userInfo').perms); const filteredRoutes = filterRoutesByPaths(staticAuthRoutes, localStg.get('userInfo')?.perms);
if (authStore.isStaticSuper) { if (authStore.isStaticSuper) {
addAuthRoutes(filteredRoutes); addAuthRoutes(filteredRoutes);
} else { } else {
+8 -3
View File
@@ -409,6 +409,7 @@ const getConfig = async () => {
const matrixConfig = async () => { const matrixConfig = async () => {
const {data,error} = await matrixConfigApi(curMatrix.value?.tool); const {data,error} = await matrixConfigApi(curMatrix.value?.tool);
if(!error){ if(!error){
// curMatrix.value = data;
console.log(data); console.log(data);
} }
} }
@@ -722,7 +723,6 @@ onMounted(() => {
<NTabPane :name="0" tab="HAZOP分析矩阵"> <NTabPane :name="0" tab="HAZOP分析矩阵">
<div class="flex flex-wrap items-start gap-6"> <div class="flex flex-wrap items-start gap-6">
<div class="shrink-0"> <div class="shrink-0">
<p class="mb-1.5 text-xs text-[var(--theme-color)] text-center">点击方框可切换等级</p>
<table class="border-collapse text-center text-[11px]"> <table class="border-collapse text-center text-[11px]">
<thead> <thead>
<tr> <tr>
@@ -737,7 +737,7 @@ onMounted(() => {
<td class="whitespace-nowrap pr-1.5 text-right leading-tight text-slate-500">S{{ 6 - row }} {{ curMatrix?.sLabels[5 - row] }}</td> <td class="whitespace-nowrap pr-1.5 text-right leading-tight text-slate-500">S{{ 6 - row }} {{ curMatrix?.sLabels[5 - row] }}</td>
<td v-for="col in 5" :key="col" class="p-0.5"> <td v-for="col in 5" :key="col" class="p-0.5">
<div <div
class="flex h-9 w-12 items-center justify-center rounded font-semibold cursor-pointer select-none" class="flex h-9 w-12 items-center justify-center rounded font-semibold"
:style="{ :style="{
backgroundColor:cellLevel(5 - row, col - 1)?.bgColor, backgroundColor:cellLevel(5 - row, col - 1)?.bgColor,
color:cellLevel(5 - row, col - 1)?.color, color:cellLevel(5 - row, col - 1)?.color,
@@ -757,7 +757,12 @@ onMounted(() => {
<!-- 等级分值区间 --> <!-- 等级分值区间 -->
<div class="min-w-72 flex-1"> <div class="min-w-72 flex-1">
<div class="mb-2 text-xs text-slate-500">风险值 = 严重性 S × 可能性 L5×5按分值区间定级</div> <div class="mb-2 text-xs text-slate-500 flex items-center gap-2">
<NButton size="tiny" ghost type="primary">
<Icon icon="ic:round-plus" class="size-14px" />新增
</NButton>
风险值 = 严重性 S × 可能性 L按分值区间定级
</div>
<div class="space-y-2"> <div class="space-y-2">
<div v-for="lv in curMatrix?.levels" :key="lv.name" class="flex items-center gap-2 rounded-lg border px-2.5 py-2"> <div v-for="lv in curMatrix?.levels" :key="lv.name" class="flex items-center gap-2 rounded-lg border px-2.5 py-2">
<span class="text-xs">背景</span> <span class="text-xs">背景</span>