😎1、修复头像上传问题(前端解决方案) 2、角色增加租户名称标识列
This commit is contained in:
parent
abf89f65ce
commit
63ad79b527
@ -2,7 +2,7 @@
|
|||||||
"name": "admin.net.pro",
|
"name": "admin.net.pro",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "2.4.33",
|
"version": "2.4.33",
|
||||||
"lastBuildTime": "2024.07.04",
|
"lastBuildTime": "2024.07.05",
|
||||||
"description": "Admin.NET 站在巨人肩膀上的 .NET 通用权限开发框架",
|
"description": "Admin.NET 站在巨人肩膀上的 .NET 通用权限开发框架",
|
||||||
"author": "zuohuaijun",
|
"author": "zuohuaijun",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
@ -79,6 +79,7 @@ export function base64ToFile(dataURL: string, fileName: string, mimeType = null)
|
|||||||
* @param mimeType {String} 文件类型
|
* @param mimeType {String} 文件类型
|
||||||
* @return {File}
|
* @return {File}
|
||||||
*/
|
*/
|
||||||
export function blobToFile(blob: Blob, fileName: string, mimeType: any) {
|
export function blobToFile(blob: Blob, fileName: string, mimeType?: string) {
|
||||||
|
if (mimeType == null) mimeType = blob.type;
|
||||||
return new File([blob], fileName, { type: mimeType });
|
return new File([blob], fileName, { type: mimeType });
|
||||||
}
|
}
|
||||||
|
|||||||
@ -130,6 +130,7 @@ const options = useVxeTable<PageRoleOutput>({
|
|||||||
{ field: 'name', title: '角色名称', minWidth: 150, showOverflow: 'tooltip' },
|
{ field: 'name', title: '角色名称', minWidth: 150, showOverflow: 'tooltip' },
|
||||||
{ field: 'code', title: '角色编码', minWidth: 150, showOverflow: 'tooltip' },
|
{ field: 'code', title: '角色编码', minWidth: 150, showOverflow: 'tooltip' },
|
||||||
{ field: 'dataScope', title: '数据范围', minWidth: 150, showOverflow: 'tooltip', slots: { default: 'row_dataScope' } },
|
{ field: 'dataScope', title: '数据范围', minWidth: 150, showOverflow: 'tooltip', slots: { default: 'row_dataScope' } },
|
||||||
|
{ field: 'tenantName', title: '租户名称', minWidth: 180, showOverflow: 'tooltip' },
|
||||||
{ field: 'orderNo', title: '排序', width: 80, showOverflow: 'tooltip' },
|
{ field: 'orderNo', title: '排序', width: 80, showOverflow: 'tooltip' },
|
||||||
{ field: 'status', title: '状态', width: 80, showOverflow: 'tooltip', slots: { default: 'row_status' } },
|
{ field: 'status', title: '状态', width: 80, showOverflow: 'tooltip', slots: { default: 'row_status' } },
|
||||||
{ field: '', title: '修改记录', width: 100, showOverflow: 'tooltip', slots: { default: 'row_record' } },
|
{ field: '', title: '修改记录', width: 100, showOverflow: 'tooltip', slots: { default: 'row_record' } },
|
||||||
|
|||||||
@ -165,7 +165,7 @@ import { storeToRefs } from 'pinia';
|
|||||||
import { ElForm, ElMessageBox, genFileId } from 'element-plus';
|
import { ElForm, ElMessageBox, genFileId } from 'element-plus';
|
||||||
import type { UploadInstance, UploadProps, UploadRawFile } from 'element-plus';
|
import type { UploadInstance, UploadProps, UploadRawFile } from 'element-plus';
|
||||||
import { useUserInfo } from '/@/stores/userInfo';
|
import { useUserInfo } from '/@/stores/userInfo';
|
||||||
import { base64ToFile } from '/@/utils/base64Conver';
|
import { base64ToFile, blobToFile } from '/@/utils/base64Conver';
|
||||||
import OrgTree from '/@/views/system/user/component/orgTree.vue';
|
import OrgTree from '/@/views/system/user/component/orgTree.vue';
|
||||||
import CropperDialog from '/@/components/cropper/index.vue';
|
import CropperDialog from '/@/components/cropper/index.vue';
|
||||||
import VueGridLayout from 'vue-grid-layout';
|
import VueGridLayout from 'vue-grid-layout';
|
||||||
@ -217,7 +217,7 @@ watch(state.signOptions, () => {
|
|||||||
|
|
||||||
// 上传头像图片
|
// 上传头像图片
|
||||||
const uploadCropperImg = async (e: any) => {
|
const uploadCropperImg = async (e: any) => {
|
||||||
var res = await getAPI(SysFileApi).apiSysFileUploadAvatarPostForm(e.img);
|
var res = await getAPI(SysFileApi).apiSysFileUploadAvatarPostForm(blobToFile(e.img, userInfos.value.account + '.png'));
|
||||||
userInfos.value.avatar = getFileUrl(res.data.result!);
|
userInfos.value.avatar = getFileUrl(res.data.result!);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user