From 37bfb87ece253f832be60420ed74761e2c8a8535 Mon Sep 17 00:00:00 2001 From: wangxiang <1827945911@qq.com> Date: Mon, 20 Feb 2023 18:07:05 +0800 Subject: [PATCH] =?UTF-8?q?:rocket:=20=E4=BC=81=E4=B8=9A=E8=AE=A4=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/controller/pushThirdParty.ts | 3 ++ src/views/system/user/userInfo/index.vue | 28 +++++++++++++++++-- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/src/api/platform/common/controller/pushThirdParty.ts b/src/api/platform/common/controller/pushThirdParty.ts index 9dfb4ee..8e1a87b 100644 --- a/src/api/platform/common/controller/pushThirdParty.ts +++ b/src/api/platform/common/controller/pushThirdParty.ts @@ -10,6 +10,7 @@ enum Api { list = '/common_proxy/common/pushThirdParty/list', add = '/common_proxy/common/pushThirdParty/save', get = '/common_proxy/common/pushThirdParty', + getByUserId = '/common_proxy/common/pushThirdParty/getByUserId', edit = '/common_proxy/common/pushThirdParty/update', del = '/common_proxy/common/pushThirdParty/remove', } @@ -22,4 +23,6 @@ export const editPushThirdParty = (params: Partial) => defHttp.p export const getPushThirdParty = (id: string) => defHttp.get({ url: `${Api.get}/${id}` }); +export const getPushThirdPartyByUserId = (id: string) => defHttp.get({ url: `${Api.getByUserId}/${id}` }); + export const delPushThirdParty = (ids: string) => defHttp.delete({ url: `${Api.del}/${ids}` }); diff --git a/src/views/system/user/userInfo/index.vue b/src/views/system/user/userInfo/index.vue index d00d12f..20f251d 100644 --- a/src/views/system/user/userInfo/index.vue +++ b/src/views/system/user/userInfo/index.vue @@ -56,14 +56,16 @@ - 长沙康来多租户 + 长沙康来公司多租户 - 申请 - 已认证 +

企业认证:

+ 申请中 + 已认证 + 申请
@@ -118,6 +120,7 @@ + @@ -133,10 +136,14 @@ import {useMessage} from '/@/hooks/web/useMessage'; import {editUser, getUser} from '/@/api/platform/system/controller/user'; import type {User} from '/@/api/platform/core/entity/user'; + import type {PushThirdParty} from '/@/api/platform/common/entity/pushThirdParty'; import {useUserStore} from '/@/store/modules/user'; import {commonUpload} from '/@/api/platform/core/controller/upload'; import {useGlobSetting} from '/@/hooks/setting'; import {isUrl} from '/@/utils/is'; + import {getPushThirdPartyByUserId} from '/@/api/platform/common/controller/pushThirdParty'; + import {useModal} from '/@/components/Modal'; + import ThirdPartyModal from '/@/views/common/push/pushThirdParty/ThirdPartyModal.vue'; interface InfoState { currentCardKey: string; @@ -144,6 +151,7 @@ uploadAvatarBtnLoading: boolean; uploadAvatarLoading: boolean; userInfo: User | any; + pushThirdParty: PushThirdParty | any; imageUrl: string; tabList: Recordable[]; } @@ -166,6 +174,7 @@ uploadAvatarLoading: false, uploadAvatarBtnLoading: false, userInfo: undefined, + pushThirdParty: undefined, imageUrl: '', tabList: [ { @@ -178,6 +187,8 @@ } ] }); + + const [registerModal, { openModal }] = useModal(); const defaultAvatarUrl = 'https://godolphinx.org/dolphin1024x1024.png'; const [registerForm, { resetFields, setFieldsValue, updateSchema, validate, clearValidate }] = useForm({ labelWidth: 100, @@ -196,8 +207,13 @@ getUser(userInfo.id).then(result => { state.userInfo = result.result; setFieldsValue(result.result); + handleRefreshPushThirdParty(); }); + function handleRefreshPushThirdParty() { + getPushThirdPartyByUserId(userInfo.id).then(pushThirdParty => state.pushThirdParty = pushThirdParty); + } + async function handleSubmit() { try { const formData = await validate(); @@ -228,6 +244,10 @@ } } + function handleCertification() { + openModal(true,{ _tag: 'add' }); + } + const getUserInfo = computed((): User & any => { let userInfo = state.userInfo || {}; userInfo.avatar || (userInfo.avatar = defaultAvatarUrl); @@ -235,6 +255,8 @@ return userInfo; }); + const getPushThirdParty = computed((): PushThirdParty & any => state.pushThirdParty || {}); + const getAvatarUrl = computed((): string => isUrl(unref(getUserInfo).avatar) ? unref(getUserInfo).avatar : apiUrl + unref(getUserInfo).avatar); const getImageUrl = computed((): string => (!state.imageUrl || isUrl(state.imageUrl)) ? state.imageUrl : apiUrl + state.imageUrl);