Skip to content

Commit

Permalink
fix: 修复编辑用户和前端路由报错
Browse files Browse the repository at this point in the history
  • Loading branch information
WangJunZzz committed Dec 6, 2024
1 parent 6bbbe24 commit 95b6056
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ public virtual async Task<IdentityUserDto> CreateAsync(IdentityUserCreateDto inp
[Authorize(IdentityPermissions.Users.Update)]
public virtual async Task<IdentityUserDto> UpdateAsync(UpdateUserInput input)
{
input.UserInfo.IsActive = true;
return await _identityUserAppService.UpdateAsync(input.UserId, input.UserInfo);
}

Expand Down
2 changes: 1 addition & 1 deletion vben28/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"vue": "3.2.33",
"vue-i18n": "^9.1.9",
"vue-json-pretty": "^2.0.6",
"vue-router": "^4.0.14",
"vue-router": "4.0.14",
"vue-types": "^4.1.1",
"xlsx": "^0.18.5",
"oidc-client": "^1.11.5",
Expand Down
3 changes: 1 addition & 2 deletions vben28/src/router/routes/basic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
LAYOUT,
EXCEPTION_COMPONENT,
PAGE_NOT_FOUND_NAME,
PAGE_NOT_FOUND_NAME_PATH,
} from '/@/router/constant';

// 404 on a page
Expand All @@ -21,7 +20,7 @@ export const PAGE_NOT_FOUND_ROUTE: AppRouteRecordRaw = {
children: [
{
path: '/:path(.*)*',
name: PAGE_NOT_FOUND_NAME_PATH,
name: PAGE_NOT_FOUND_NAME,
component: EXCEPTION_COMPONENT,
meta: {
title: 'ErrorPage',
Expand Down
1 change: 0 additions & 1 deletion vben28/src/store/modules/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ export const useUserStore = defineStore({
*/
async logout(goLogin = false) {
try {
debugger;
if (this.userInfo?.isSts) {
await useOidcLogout();
} else {
Expand Down
7 changes: 7 additions & 0 deletions vben28/src/views/admin/users/AbpUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,13 @@ export const createFormSchema: FormSchema[] = [
];

export const editFormSchema: FormSchema[] = [
{
field: 'isActive',
component: 'Input',
label: t('routes.admin.userManagement_name'),
labelWidth: 130,
show: false,
},
{
field: 'userName',
component: 'Input',
Expand Down
5 changes: 3 additions & 2 deletions vben28/src/views/admin/users/EditAbpUser.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ export default defineComponent({
name: data.record.name,
userName: data.record.userName,
email: data.record.email,
phoneNumber: data.record.phoneNumber
phoneNumber: data.record.phoneNumber,
isActive: data.record.isActive,
});
});
Expand Down Expand Up @@ -127,7 +128,7 @@ export default defineComponent({
userInfo.concurrencyStamp = currentUserInfo.concurrencyStamp;
userInfo.roleNames = defaultRolesRef.value;
userInfo.password = request.password;
userInfo.isActive = request.isActive;
updateUserInput.userId = currentUserInfo.id;
updateUserInput.userInfo = userInfo;
await updateUserAsync({
Expand Down

0 comments on commit 95b6056

Please sign in to comment.