feat: 管理中心路由调整、选择公司逻辑调整

This commit is contained in:
renxiaodong
2025-06-23 05:58:04 -04:00
parent 7b79443980
commit 82dfa3faeb
11 changed files with 134 additions and 86 deletions

View File

@ -4,7 +4,7 @@
<template #info="{ record }">
<div class="pt-3px pb-3px">
<a-avatar :image-url="record.head_image" :size="32" />
{{ record.name }}
{{ record.name || '-' }}
<icon-edit size="13" class="ml-8px" @click="openEditInfoModal" />
</div>
</template>
@ -170,15 +170,17 @@ async function handleFileChange(event: Event) {
const file = target.files?.[0];
if (file) {
const fileExtension = getFileExtension(file.name);
const res = await fetchImageUploadFile({
const { data } = await fetchImageUploadFile({
suffix: fileExtension,
});
const { upload_url, file_name, file_url } = data;
const blob = new Blob([file], { type: file.type });
await axios.put(res.upload_url, blob, {
await axios.put(upload_url, blob, {
headers: { 'Content-Type': file.type },
});
userInfoForm.head_image = res.file_name;
userInfoForm.file_url = res.file_url;
userInfoForm.head_image = file_name;
userInfoForm.file_url = file_url;
}
}
function openEditImageModal() {
@ -191,8 +193,6 @@ function openEditMobileModal() {
async function handleSubmitUserInfo() {
await updateMyInfo(userInfoForm);
store.setUserName(userInfoForm.name);
store.setUserHeadImage(userInfoForm.file_url);
AMessage.success('修改成功!');
}
@ -235,7 +235,6 @@ async function handleUpdateMobile() {
const res = await formRef.value.validate();
if (res === true || res === undefined) {
await updateMobile(form);
store.setUserMobile(form.mobile);
AMessage.success('修改成功!');
}
}