diff --git a/src/api/jyh/index.ts b/src/api/jyh/index.ts index 0882260..e962abd 100644 --- a/src/api/jyh/index.ts +++ b/src/api/jyh/index.ts @@ -490,3 +490,11 @@ export function loginAccess() { } }); } +// 查询用户是否认证 +export function fetchCheckAuthenticate(data) { + return request({ + url: `/api/v1/user/checkAuthenticate`, + method: 'post', + data: data, + }); +} diff --git a/src/views/Jyh/PersonalCenter/index.vue b/src/views/Jyh/PersonalCenter/index.vue index 7c89f78..d94beae 100644 --- a/src/views/Jyh/PersonalCenter/index.vue +++ b/src/views/Jyh/PersonalCenter/index.vue @@ -49,6 +49,7 @@ import SubscribeList from './Detail/SubscribeList.vue'; import PersonalSettings from './Detail/PersonalSettings.vue'; import { useAccount } from '@/utils/hooks/useAccount'; import { Message } from 'vue-devui/message'; +import { fetchCheckAuthenticate } from '@/api/jyh'; const { namespace } = getOrgInfo(); const avatarUrl = '/src/assets/imgs/avatar/male.png'; @@ -71,10 +72,14 @@ const openDelete = (row: any) => { const router = useRouter(); // 前往治理中心按钮点击事件 -const goToGovernCenter = () => { - // Message.warning('请联系平台管理员,开通账号权限'); - // 可以在此添加跳转逻辑,当前无权限时不实际跳转 - window.location.href = VITE_GOVERNANCE_HOST; +const goToGovernCenter = async () => { + const res = await fetchCheckAuthenticate({}); + if(res.data.code!==200) return + if (res.data.data) { + window.location.href = VITE_GOVERNANCE_HOST; + } else { + Message.warning('请联系平台管理员,开通账号权限'); + } }; // 分页