Browse Source

🚀 企业认证

master
wangxiang 2 years ago
parent
commit
37bfb87ece
  1. 3
      src/api/platform/common/controller/pushThirdParty.ts
  2. 28
      src/views/system/user/userInfo/index.vue

3
src/api/platform/common/controller/pushThirdParty.ts

@ -10,6 +10,7 @@ enum Api { @@ -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<PushThirdParty>) => defHttp.p @@ -22,4 +23,6 @@ export const editPushThirdParty = (params: Partial<PushThirdParty>) => defHttp.p
export const getPushThirdParty = (id: string) => defHttp.get<PushThirdParty>({ url: `${Api.get}/${id}` });
export const getPushThirdPartyByUserId = (id: string) => defHttp.get<PushThirdParty>({ url: `${Api.getByUserId}/${id}` });
export const delPushThirdParty = (ids: string) => defHttp.delete({ url: `${Api.del}/${ids}` });

28
src/views/system/user/userInfo/index.vue

@ -56,14 +56,16 @@ @@ -56,14 +56,16 @@
<template #label>
<Icon icon="fa6-solid:city"/>
</template>
长沙康来多租户
长沙康来公司多租户
</ADescriptionsItem>
<ADescriptionsItem span="24">
<template #label>
<Icon icon="fa6-solid:robot"/>
</template>
<a href="#">申请</a>
已认证
<h1 style="margin-right: 5px">企业认证:</h1>
<a v-if="getPushThirdParty.status == '0'">申请中</a>
<a v-else-if="getPushThirdParty.status == '1'">已认证</a>
<a v-else @click="handleCertification">申请</a>
</ADescriptionsItem>
</ADescriptions>
</div>
@ -118,6 +120,7 @@ @@ -118,6 +120,7 @@
</ACard>
</ACard>
</PageWrapper>
<ThirdPartyModal @register="registerModal" @success="handleRefreshPushThirdParty"/>
</div>
</template>
@ -133,10 +136,14 @@ @@ -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 @@ @@ -144,6 +151,7 @@
uploadAvatarBtnLoading: boolean;
uploadAvatarLoading: boolean;
userInfo: User | any;
pushThirdParty: PushThirdParty | any;
imageUrl: string;
tabList: Recordable[];
}
@ -166,6 +174,7 @@ @@ -166,6 +174,7 @@
uploadAvatarLoading: false,
uploadAvatarBtnLoading: false,
userInfo: undefined,
pushThirdParty: undefined,
imageUrl: '',
tabList: [
{
@ -178,6 +187,8 @@ @@ -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 @@ @@ -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 @@ @@ -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 @@ @@ -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);

Loading…
Cancel
Save