feat:添加角色用户管理,修复一堆相关问题
This commit is contained in:
@@ -195,7 +195,7 @@ namespace Yi.Framework.Rbac.Application.Services.System
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="input"></param>
|
/// <param name="input"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task CreateAuthUserAsync(RoleAuthUserCreateOrDeleteInput input)
|
public async Task CreateAuthUserAsync([FromBody] RoleAuthUserCreateOrDeleteInput input)
|
||||||
{
|
{
|
||||||
var userRoleEntities = input.UserIds.Select(u => new UserRoleEntity { RoleId = input.RoleId, UserId = u })
|
var userRoleEntities = input.UserIds.Select(u => new UserRoleEntity { RoleId = input.RoleId, UserId = u })
|
||||||
.ToList();
|
.ToList();
|
||||||
@@ -208,7 +208,7 @@ namespace Yi.Framework.Rbac.Application.Services.System
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="input"></param>
|
/// <param name="input"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task DeleteAuthUserAsync(RoleAuthUserCreateOrDeleteInput input)
|
public async Task DeleteAuthUserAsync([FromBody] RoleAuthUserCreateOrDeleteInput input)
|
||||||
{
|
{
|
||||||
await _userRoleRepository._Db.Deleteable<UserRoleEntity>().Where(x => x.RoleId == input.RoleId)
|
await _userRoleRepository._Db.Deleteable<UserRoleEntity>().Where(x => x.RoleId == input.RoleId)
|
||||||
.Where(x => input.UserIds.Contains(x.UserId))
|
.Where(x => input.UserIds.Contains(x.UserId))
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ export const dynamicRoutes = [
|
|||||||
permissions: ['system:user:edit'],
|
permissions: ['system:user:edit'],
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: 'role/:userId(\\d+)',
|
path: 'role/:userId([\\w-]+)',
|
||||||
component: () => import('@/views/system/user/authRole'),
|
component: () => import('@/views/system/user/authRole'),
|
||||||
name: 'AuthRole',
|
name: 'AuthRole',
|
||||||
meta: { title: '分配角色', activeMenu: '/system/user' }
|
meta: { title: '分配角色', activeMenu: '/system/user' }
|
||||||
@@ -109,7 +109,7 @@ export const dynamicRoutes = [
|
|||||||
permissions: ['system:role:edit'],
|
permissions: ['system:role:edit'],
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: 'user/:roleId(\\d+)',
|
path: 'user/:roleId([\\w-]+)',
|
||||||
component: () => import('@/views/system/role/authUser'),
|
component: () => import('@/views/system/role/authUser'),
|
||||||
name: 'AuthUser',
|
name: 'AuthUser',
|
||||||
meta: { title: '分配用户', activeMenu: '/system/role' }
|
meta: { title: '分配用户', activeMenu: '/system/role' }
|
||||||
@@ -151,7 +151,7 @@ export const dynamicRoutes = [
|
|||||||
permissions: ['tool:gen:edit'],
|
permissions: ['tool:gen:edit'],
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: 'index/:tableId(\\d+)',
|
path: 'index/:tableId([\\w-]+)',
|
||||||
component: () => import('@/views/tool/gen/editTable'),
|
component: () => import('@/views/tool/gen/editTable'),
|
||||||
name: 'GenEdit',
|
name: 'GenEdit',
|
||||||
meta: { title: '修改生成配置', activeMenu: '/tool/gen' }
|
meta: { title: '修改生成配置', activeMenu: '/tool/gen' }
|
||||||
|
|||||||
@@ -74,10 +74,10 @@
|
|||||||
<el-button link icon="CircleCheck" @click="handleDataScope(scope.row)"
|
<el-button link icon="CircleCheck" @click="handleDataScope(scope.row)"
|
||||||
v-hasPermi="['system:role:edit']"></el-button>
|
v-hasPermi="['system:role:edit']"></el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<!-- <el-tooltip content="分配用户" placement="top" v-if="scope.row.roleId !== 1">
|
<el-tooltip content="分配用户" placement="top" v-if="scope.row.roleId !== 1">
|
||||||
<el-button link icon="User" @click="handleAuthUser(scope.row)" v-hasPermi="['system:role:edit']">
|
<el-button link icon="User" @click="handleAuthUser(scope.row)" v-hasPermi="['system:role:edit']">
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-tooltip> -->
|
</el-tooltip>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|||||||
@@ -124,9 +124,8 @@ function handleSelectUser() {
|
|||||||
proxy.$modal.msgError("请选择要分配的用户");
|
proxy.$modal.msgError("请选择要分配的用户");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
authUserSelectAll({ roleId: roleId, userIds:uIds }).then(res => {
|
authUserSelectAll({ roleId: roleId, userIds:uIds }).then(res => {
|
||||||
if (res.statusCode == 200) {
|
if (res.status == 200 || res.status == 204) {
|
||||||
proxy.$modal.msgSuccess("成功");
|
proxy.$modal.msgSuccess("成功");
|
||||||
visible.value = false;
|
visible.value = false;
|
||||||
emit("ok");
|
emit("ok");
|
||||||
|
|||||||
Reference in New Issue
Block a user