😎1、获取用户信息返回角色详细集合 2、完善角色相关翻译文件 3、更新前端请求文件
This commit is contained in:
parent
f7d298df36
commit
699063658b
@ -212,7 +212,10 @@ public class AppAuthService : IDynamicApiController, ITransient
|
|||||||
// 职位
|
// 职位
|
||||||
var pos = await _sysUserRep.ChangeRepository<SqlSugarRepository<SysPos>>().GetByIdAsync(user.PosId);
|
var pos = await _sysUserRep.ChangeRepository<SqlSugarRepository<SysPos>>().GetByIdAsync(user.PosId);
|
||||||
// 角色集合
|
// 角色集合
|
||||||
var roleIds = await _sysUserRep.ChangeRepository<SqlSugarRepository<SysUserRole>>().AsQueryable().Where(u => u.UserId == user.Id).Select(u => u.RoleId).ToListAsync();
|
var roles = await _sysUserRep.ChangeRepository<SqlSugarRepository<SysUserRole>>().AsQueryable()
|
||||||
|
.LeftJoin<SysRole>((u, a) => u.RoleId == a.Id)
|
||||||
|
.Where(u => u.UserId == user.Id)
|
||||||
|
.Select((u, a) => new RoleDto { Id = a.Id, Name = a.Name, Code = a.Code }).ToListAsync();
|
||||||
// 接口集合
|
// 接口集合
|
||||||
var apis = (await _sysRoleService.GetUserApiList())[0];
|
var apis = (await _sysRoleService.GetUserApiList())[0];
|
||||||
|
|
||||||
@ -233,7 +236,7 @@ public class AppAuthService : IDynamicApiController, ITransient
|
|||||||
OrgType = org?.Type,
|
OrgType = org?.Type,
|
||||||
PosName = pos?.Name,
|
PosName = pos?.Name,
|
||||||
Apis = apis,
|
Apis = apis,
|
||||||
RoleIds = roleIds
|
Roles = roles
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -99,7 +99,7 @@ public class LoginUserOutput
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 角色集合
|
/// 角色集合
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<long> RoleIds { get; set; }
|
public List<RoleDto> Roles { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 水印文字
|
/// 水印文字
|
||||||
@ -110,4 +110,25 @@ public class LoginUserOutput
|
|||||||
/// 最新密码修改时间
|
/// 最新密码修改时间
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DateTime? LastChangePasswordTime;
|
public DateTime? LastChangePasswordTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 角色
|
||||||
|
/// </summary>
|
||||||
|
public class RoleDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 角色Id
|
||||||
|
/// </summary>
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 名称
|
||||||
|
/// </summary>
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 编码
|
||||||
|
/// </summary>
|
||||||
|
public string Code { get; set; }
|
||||||
}
|
}
|
||||||
@ -293,7 +293,10 @@ public class SysAuthService : IDynamicApiController, ITransient
|
|||||||
// 职位
|
// 职位
|
||||||
var pos = await _sysUserRep.ChangeRepository<SqlSugarRepository<SysPos>>().GetByIdAsync(user.PosId);
|
var pos = await _sysUserRep.ChangeRepository<SqlSugarRepository<SysPos>>().GetByIdAsync(user.PosId);
|
||||||
// 角色集合
|
// 角色集合
|
||||||
var roleIds = await _sysUserRep.ChangeRepository<SqlSugarRepository<SysUserRole>>().AsQueryable().Where(u => u.UserId == user.Id).Select(u => u.RoleId).ToListAsync();
|
var roles = await _sysUserRep.ChangeRepository<SqlSugarRepository<SysUserRole>>().AsQueryable()
|
||||||
|
.LeftJoin<SysRole>((u, a) => u.RoleId == a.Id)
|
||||||
|
.Where(u => u.UserId == user.Id)
|
||||||
|
.Select((u, a) => new RoleDto { Id = a.Id, Name=a.Name, Code = a.Code }).ToListAsync();
|
||||||
// 接口集合
|
// 接口集合
|
||||||
var apis = (await App.GetRequiredService<SysRoleService>().GetUserApiList())[0];
|
var apis = (await App.GetRequiredService<SysRoleService>().GetUserApiList())[0];
|
||||||
// 个性化水印文字(若系统水印为空则不显示)
|
// 个性化水印文字(若系统水印为空则不显示)
|
||||||
@ -319,7 +322,7 @@ public class SysAuthService : IDynamicApiController, ITransient
|
|||||||
OrgType = org?.Type,
|
OrgType = org?.Type,
|
||||||
PosName = pos?.Name,
|
PosName = pos?.Name,
|
||||||
Apis = apis,
|
Apis = apis,
|
||||||
RoleIds = roleIds,
|
Roles = roles,
|
||||||
WatermarkText = watermarkText,
|
WatermarkText = watermarkText,
|
||||||
LastChangePasswordTime = user.LastChangePasswordTime
|
LastChangePasswordTime = user.LastChangePasswordTime
|
||||||
};
|
};
|
||||||
|
|||||||
@ -397,6 +397,7 @@ export * from './report-data-source-output';
|
|||||||
export * from './reset-column-custom-input';
|
export * from './reset-column-custom-input';
|
||||||
export * from './reset-pwd-user-input';
|
export * from './reset-pwd-user-input';
|
||||||
export * from './role-api-input';
|
export * from './role-api-input';
|
||||||
|
export * from './role-dto';
|
||||||
export * from './role-input';
|
export * from './role-input';
|
||||||
export * from './role-menu-input';
|
export * from './role-menu-input';
|
||||||
export * from './role-org-input';
|
export * from './role-org-input';
|
||||||
|
|||||||
@ -13,6 +13,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { AccountTypeEnum } from './account-type-enum';
|
import { AccountTypeEnum } from './account-type-enum';
|
||||||
|
import { RoleDto } from './role-dto';
|
||||||
/**
|
/**
|
||||||
* 用户登录信息
|
* 用户登录信息
|
||||||
*
|
*
|
||||||
@ -158,10 +159,10 @@ export interface LoginUserOutput {
|
|||||||
/**
|
/**
|
||||||
* 角色集合
|
* 角色集合
|
||||||
*
|
*
|
||||||
* @type {Array<number>}
|
* @type {Array<RoleDto>}
|
||||||
* @memberof LoginUserOutput
|
* @memberof LoginUserOutput
|
||||||
*/
|
*/
|
||||||
roleIds?: Array<number> | null;
|
roles?: Array<RoleDto> | null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 水印文字
|
* 水印文字
|
||||||
|
|||||||
46
Web/src/api-services/models/role-dto.ts
Normal file
46
Web/src/api-services/models/role-dto.ts
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* Admin.NET 通用权限开发平台
|
||||||
|
* 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。<br/><u><b><font color='FF0000'> 👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!</font></b></u>
|
||||||
|
*
|
||||||
|
* OpenAPI spec version: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen.git
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 角色
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface RoleDto
|
||||||
|
*/
|
||||||
|
export interface RoleDto {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 角色Id
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof RoleDto
|
||||||
|
*/
|
||||||
|
id?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 名称
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof RoleDto
|
||||||
|
*/
|
||||||
|
name?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编码
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof RoleDto
|
||||||
|
*/
|
||||||
|
code?: string | null;
|
||||||
|
}
|
||||||
@ -221,6 +221,7 @@ export default {
|
|||||||
editRole: 'Edit Role',
|
editRole: 'Edit Role',
|
||||||
confirmDeleteRole: 'Are you sure to delete role: [{roleName}]?',
|
confirmDeleteRole: 'Are you sure to delete role: [{roleName}]?',
|
||||||
dataScope: 'Data Scope',
|
dataScope: 'Data Scope',
|
||||||
|
sysFlag: 'System Flag',
|
||||||
tenantName: 'Tenant Name',
|
tenantName: 'Tenant Name',
|
||||||
roleCodeRequired: 'Role code is required',
|
roleCodeRequired: 'Role code is required',
|
||||||
roleNameRequired: 'Role name is required',
|
roleNameRequired: 'Role name is required',
|
||||||
|
|||||||
@ -223,6 +223,7 @@ export default {
|
|||||||
editRole: '编辑角色',
|
editRole: '编辑角色',
|
||||||
confirmDeleteRole: '确定删除角色:【{roleName}】?',
|
confirmDeleteRole: '确定删除角色:【{roleName}】?',
|
||||||
dataScope: '数据范围',
|
dataScope: '数据范围',
|
||||||
|
sysFlag: '是否内置',
|
||||||
tenantName: '租户名称',
|
tenantName: '租户名称',
|
||||||
role: '角色',
|
role: '角色',
|
||||||
apiRoute: 'API路由',
|
apiRoute: 'API路由',
|
||||||
|
|||||||
@ -87,7 +87,7 @@ export const useUserInfo = defineStore('userInfo', {
|
|||||||
orgName: d.orgName,
|
orgName: d.orgName,
|
||||||
posName: d.posName,
|
posName: d.posName,
|
||||||
posId: d.posId,
|
posId: d.posId,
|
||||||
roles: d.roleIds,
|
roles: d.roles,
|
||||||
authApiList: d.apis,
|
authApiList: d.apis,
|
||||||
lastChangePasswordTime: d.lastChangePasswordTime,
|
lastChangePasswordTime: d.lastChangePasswordTime,
|
||||||
time: new Date().getTime(),
|
time: new Date().getTime(),
|
||||||
|
|||||||
@ -139,7 +139,7 @@ const options = useVxeTable<PageRoleOutput>(
|
|||||||
{ field: 'name', title: i18n.t('message.list.roleName'), minWidth: 150, showOverflow: 'tooltip' },
|
{ field: 'name', title: i18n.t('message.list.roleName'), minWidth: 150, showOverflow: 'tooltip' },
|
||||||
{ field: 'code', title: i18n.t('message.list.roleCode'), minWidth: 150, showOverflow: 'tooltip' },
|
{ field: 'code', title: i18n.t('message.list.roleCode'), minWidth: 150, showOverflow: 'tooltip' },
|
||||||
{ field: 'dataScope', title: i18n.t('message.list.dataScope'), minWidth: 150, showOverflow: 'tooltip', slots: { default: 'row_dataScope' } },
|
{ field: 'dataScope', title: i18n.t('message.list.dataScope'), minWidth: 150, showOverflow: 'tooltip', slots: { default: 'row_dataScope' } },
|
||||||
{ field: 'sysFlag', title: '是否内置', width: 80, showOverflow: 'tooltip', slots: { default: 'row_sysFlag' } },
|
{ field: 'sysFlag', title: i18n.t('message.list.sysFlag'), width: 80, showOverflow: 'tooltip', slots: { default: 'row_sysFlag' } },
|
||||||
{ field: 'tenantName', title: i18n.t('message.list.tenantName'), minWidth: 180, showOverflow: 'tooltip' },
|
{ field: 'tenantName', title: i18n.t('message.list.tenantName'), minWidth: 180, showOverflow: 'tooltip' },
|
||||||
{ field: 'orderNo', title: i18n.t('message.list.orderNo'), width: 80, showOverflow: 'tooltip' },
|
{ field: 'orderNo', title: i18n.t('message.list.orderNo'), width: 80, showOverflow: 'tooltip' },
|
||||||
{ field: 'status', title: i18n.t('message.list.status'), width: 80, showOverflow: 'tooltip', slots: { default: 'row_status' } },
|
{ field: 'status', title: i18n.t('message.list.status'), width: 80, showOverflow: 'tooltip', slots: { default: 'row_status' } },
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user