Skip to content

Commit e33a0c3

Browse files
author
agile.zhou
committed
Fix user list lang issue
1 parent 52dcc24 commit e33a0c3

File tree

3 files changed

+10
-23
lines changed

3 files changed

+10
-23
lines changed

src/AgileConfig.Server.Apisite/Controllers/UserController.cs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,6 @@ public async Task<IActionResult> Search(string userName, string team, int curren
5656

5757
var pageList = users.Skip((current - 1) * pageSize).Take(pageSize);
5858
var total = users.Count;
59-
var totalPages = total / pageSize;
60-
if ((total % pageSize) > 0)
61-
{
62-
totalPages++;
63-
}
6459

6560
var vms = new List<UserVM>();
6661
foreach (var item in pageList)
@@ -93,7 +88,7 @@ public async Task<IActionResult> Add([FromBody] UserVM model)
9388
{
9489
if (model == null)
9590
{
96-
throw new ArgumentNullException("model");
91+
throw new ArgumentNullException(nameof(model));
9792
}
9893

9994
var oldUsers = await _userService.GetUsersByNameAsync(model.UserName);
@@ -137,7 +132,7 @@ public async Task<IActionResult> Edit([FromBody] UserVM model)
137132
{
138133
if (model == null)
139134
{
140-
throw new ArgumentNullException("model");
135+
throw new ArgumentNullException(nameof(model));
141136
}
142137

143138
var user = await _userService.GetUserAsync(model.Id);
@@ -210,7 +205,7 @@ public async Task<IActionResult> Delete(string userId)
210205
{
211206
if (string.IsNullOrEmpty(userId))
212207
{
213-
throw new ArgumentNullException("userId");
208+
throw new ArgumentNullException(nameof(userId));
214209
}
215210

216211
var user = await _userService.GetUserAsync(userId);
@@ -238,7 +233,7 @@ public async Task<IActionResult> Delete(string userId)
238233
}
239234

240235
[HttpGet]
241-
public async Task<IActionResult> adminUsers()
236+
public async Task<IActionResult> AdminUsers()
242237
{
243238
var adminUsers = await _userService.GetUsersByRoleAsync(Role.Admin);
244239
adminUsers = adminUsers.Where(x => x.Status == UserStatus.Normal).ToList();

src/AgileConfig.Server.Data.Entity/UserRole.cs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,11 @@ public class UserRole: IEntity<string>
2727

2828
public enum Role
2929
{
30-
[Description("超级管理员")]
30+
[Description("Super Administrator")]
3131
SuperAdmin = 0,
32-
[Description("管理员")]
32+
[Description("Administrator")]
3333
Admin = 1,
34-
[Description("操作员")]
34+
[Description("Operator")]
3535
NormalUser = 2,
3636
}
37-
38-
public enum AppRole
39-
{
40-
APP_Editor = 10, //app维护
41-
Config_Publisher = 11, // 配置项发布下线
42-
Config_Editor = 12 //配置项编辑
43-
}
44-
4537
}

src/AgileConfig.Server.UI/react-ui-antd/src/pages/User/comps/updateUser.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,19 +69,19 @@ const UpdateForm : React.FC<UpdateUserProps> = (props)=>{
6969
{
7070
value: 1,
7171
label: intl.formatMessage({
72-
id: 'pages.user.role.admin',
72+
id: 'pages.user.usertype.admin',
7373
}),
7474
},
7575
{
7676
value: 2,
7777
label: intl.formatMessage({
78-
id: 'pages.user.role.operator',
78+
id: 'pages.user.usertype.normaluser',
7979
}),
8080
}
8181
]:[{
8282
value: 2,
8383
label: intl.formatMessage({
84-
id: 'pages.user.role.operator',
84+
id: 'pages.user.usertype.normaluser',
8585
}),
8686
}]
8787
}

0 commit comments

Comments
 (0)