😎1、修复头像上传问题(前端解决方案) 2、角色增加租户名称标识列
This commit is contained in:
parent
abf89f65ce
commit
63ad79b527
@ -478,11 +478,11 @@ public class SysFileService : IDynamicApiController, ITransient
|
||||
if (ids == null || ids.Count == 0)
|
||||
return 0;
|
||||
return await _sysFileRep.AsUpdateable()
|
||||
.SetColumns(m => m.RelationName == relationName)
|
||||
.SetColumns(m => m.RelationId == relationId)
|
||||
.SetColumns(m => m.BelongId == belongId)
|
||||
.Where(m => ids.Contains(m.Id))
|
||||
.ExecuteCommandAsync();
|
||||
.SetColumns(m => m.RelationName == relationName)
|
||||
.SetColumns(m => m.RelationId == relationId)
|
||||
.SetColumns(m => m.BelongId == belongId)
|
||||
.Where(m => ids.Contains(m.Id))
|
||||
.ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -494,11 +494,11 @@ public class SysFileService : IDynamicApiController, ITransient
|
||||
public async Task<List<FileOutput>> GetRelationFiles([FromQuery] RelationQueryInput input)
|
||||
{
|
||||
return await _sysFileRep.AsQueryable()
|
||||
.Where(m => !m.IsDelete)
|
||||
.WhereIF(input.RelationId.HasValue && input.RelationId > 0, m => m.RelationId == input.RelationId)
|
||||
.WhereIF(input.BelongId.HasValue && input.BelongId > 0, m => m.BelongId == input.BelongId.Value)
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.RelationName), m => m.RelationName == input.RelationName)
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.FileTypes), m => input.GetFileTypeBS().Contains(m.FileType))
|
||||
.Where(m => !m.IsDelete)
|
||||
.WhereIF(input.RelationId.HasValue && input.RelationId > 0, m => m.RelationId == input.RelationId)
|
||||
.WhereIF(input.BelongId.HasValue && input.BelongId > 0, m => m.BelongId == input.BelongId.Value)
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.RelationName), m => m.RelationName == input.RelationName)
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.FileTypes), m => input.GetFileTypeBS().Contains(m.FileType))
|
||||
.Select(m => new FileOutput
|
||||
{
|
||||
Id = m.Id,
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
"name": "admin.net.pro",
|
||||
"type": "module",
|
||||
"version": "2.4.33",
|
||||
"lastBuildTime": "2024.07.04",
|
||||
"lastBuildTime": "2024.07.05",
|
||||
"description": "Admin.NET 站在巨人肩膀上的 .NET 通用权限开发框架",
|
||||
"author": "zuohuaijun",
|
||||
"license": "MIT",
|
||||
|
||||
@ -79,6 +79,7 @@ export function base64ToFile(dataURL: string, fileName: string, mimeType = null)
|
||||
* @param mimeType {String} 文件类型
|
||||
* @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 });
|
||||
}
|
||||
|
||||
@ -130,6 +130,7 @@ const options = useVxeTable<PageRoleOutput>({
|
||||
{ field: 'name', title: '角色名称', minWidth: 150, showOverflow: 'tooltip' },
|
||||
{ field: 'code', title: '角色编码', minWidth: 150, showOverflow: 'tooltip' },
|
||||
{ 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: 'status', title: '状态', width: 80, showOverflow: 'tooltip', slots: { default: 'row_status' } },
|
||||
{ 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 type { UploadInstance, UploadProps, UploadRawFile } from 'element-plus';
|
||||
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 CropperDialog from '/@/components/cropper/index.vue';
|
||||
import VueGridLayout from 'vue-grid-layout';
|
||||
@ -217,7 +217,7 @@ watch(state.signOptions, () => {
|
||||
|
||||
// 上传头像图片
|
||||
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!);
|
||||
};
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user