diff --git a/maxkey-persistence/src/main/java/org/maxkey/persistence/mapper/AccountsMapper.java b/maxkey-persistence/src/main/java/org/maxkey/persistence/mapper/AccountsMapper.java index 097ddd5a0..5f26d3ec0 100644 --- a/maxkey-persistence/src/main/java/org/maxkey/persistence/mapper/AccountsMapper.java +++ b/maxkey-persistence/src/main/java/org/maxkey/persistence/mapper/AccountsMapper.java @@ -24,6 +24,7 @@ import java.util.List; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; +import org.apache.ibatis.annotations.Update; import org.apache.mybatis.jpa.persistence.IJpaBaseMapper; import org.maxkey.entity.Accounts; import org.maxkey.entity.AccountsStrategy; @@ -44,4 +45,7 @@ public interface AccountsMapper extends IJpaBaseMapper { @Select("select * from mxk_accounts where appid=#{appId} and relatedusername=#{relatedUsername}") public List queryByAppIdAndAccount(@Param ("appId") String appId,@Param ("relatedUsername") String relatedUsername); + + @Update("update mxk_accounts set status = #{status} where id= #{id}") + public int updateStatus(Accounts accounts); } diff --git a/maxkey-persistence/src/main/java/org/maxkey/persistence/mapper/UserInfoMapper.java b/maxkey-persistence/src/main/java/org/maxkey/persistence/mapper/UserInfoMapper.java index 787d4ebfa..4696f732e 100644 --- a/maxkey-persistence/src/main/java/org/maxkey/persistence/mapper/UserInfoMapper.java +++ b/maxkey-persistence/src/main/java/org/maxkey/persistence/mapper/UserInfoMapper.java @@ -74,4 +74,7 @@ public interface UserInfoMapper extends IJpaBaseMapper{ @Update("update mxk_userinfo set gridlist = #{gridList} where id = #{id}") public int updateGridList(UserInfo userInfo) ; + + @Update("update mxk_userinfo set status = #{status} where id = #{id}") + public int updateStatus(UserInfo userInfo) ; } diff --git a/maxkey-persistence/src/main/java/org/maxkey/persistence/service/AccountsService.java b/maxkey-persistence/src/main/java/org/maxkey/persistence/service/AccountsService.java index 06a3db7ef..ca5c8d3de 100644 --- a/maxkey-persistence/src/main/java/org/maxkey/persistence/service/AccountsService.java +++ b/maxkey-persistence/src/main/java/org/maxkey/persistence/service/AccountsService.java @@ -109,6 +109,9 @@ public class AccountsService extends JpaBaseService{ return false; } + public boolean updateStatus(Accounts accounts) { + return this.getMapper().updateStatus(accounts) > 0; + } public boolean remove(String id) { Accounts account = this.get(id); if (super.remove(id)) { diff --git a/maxkey-persistence/src/main/java/org/maxkey/persistence/service/UserInfoService.java b/maxkey-persistence/src/main/java/org/maxkey/persistence/service/UserInfoService.java index d6c02ac0c..a89f1b07d 100644 --- a/maxkey-persistence/src/main/java/org/maxkey/persistence/service/UserInfoService.java +++ b/maxkey-persistence/src/main/java/org/maxkey/persistence/service/UserInfoService.java @@ -334,7 +334,7 @@ public class UserInfoService extends JpaBaseService { public void updateLocked(UserInfo userInfo) { try { if(userInfo != null && StringUtils.isNotEmpty(userInfo.getId())) { - userInfo.setIsLocked(ConstsStatus.STOP); + userInfo.setIsLocked(ConstsStatus.LOCK); getMapper().updateLocked(userInfo); } } catch(Exception e) { @@ -397,6 +397,10 @@ public class UserInfoService extends JpaBaseService { public int updateProfile(UserInfo userInfo){ return getMapper().updateProfile(userInfo); } + + public boolean updateStatus(UserInfo userInfo) { + return getMapper().updateStatus(userInfo) > 0; + } public void setPasswordPolicyValidator(PasswordPolicyValidator passwordPolicyValidator) { this.passwordPolicyValidator = passwordPolicyValidator; diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/entity/BaseEntity.ts b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/entity/BaseEntity.ts index 663016f6a..13582c6c8 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/entity/BaseEntity.ts +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/entity/BaseEntity.ts @@ -1,19 +1,18 @@ /* * Copyright [2022] [MaxKey of copyright http://www.maxkey.top] - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ - export class BaseEntity { id!: String; @@ -23,6 +22,7 @@ export class BaseEntity { status!: Number; description!: String; switch_status: boolean = false; + str_status!: String; constructor() { this.status = 1; diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/entity/ChangePassword.ts b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/entity/ChangePassword.ts new file mode 100644 index 000000000..64d51437f --- /dev/null +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/entity/ChangePassword.ts @@ -0,0 +1,30 @@ +/* + * Copyright [2022] [MaxKey of copyright http://www.maxkey.top] + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +import { BaseEntity } from './BaseEntity'; + +export class ChangePassword extends BaseEntity { + userId!: String; + username!: String; + email!: String; + mobile!: String; + displayName!: String; + oldPassword!: String; + password!: String; + confirmPassword!: String; + decipherable!: String; +} diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/entity/PageResults.ts b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/entity/PageResults.ts index 10f798765..bb8756e98 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/entity/PageResults.ts +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/entity/PageResults.ts @@ -1,19 +1,18 @@ /* * Copyright [2022] [MaxKey of copyright http://www.maxkey.top] - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ - import format from 'date-fns/format'; import { NzSafeAny } from 'ng-zorro-antd/core/types'; diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/entity/Users.ts b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/entity/Users.ts index 62af1b50e..062de06bc 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/entity/Users.ts +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/entity/Users.ts @@ -1,19 +1,18 @@ /* * Copyright [2022] [MaxKey of copyright http://www.maxkey.top] - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ - import { BaseEntity } from './BaseEntity'; @@ -143,7 +142,8 @@ export class Users extends BaseEntity { switch_dynamic: boolean = false; gender_select!: String; - + str_married!: String; + str_idType!: String; constructor() { super(); this.status = 1; @@ -152,6 +152,8 @@ export class Users extends BaseEntity { this.userType = 'EMPLOYEE'; this.userState = 'RESIDENT'; this.gender_select = '1'; + this.str_married = '0'; + this.str_idType = '0'; } override init(data: any): void { @@ -164,6 +166,9 @@ export class Users extends BaseEntity { } else { this.gender_select = '2'; } + this.str_status = `${this.status}`; + this.str_married = `${this.married}`; + this.str_idType = `${this.idType}`; } override trans(): void { if (this.switch_status) { @@ -177,5 +182,8 @@ export class Users extends BaseEntity { } else { this.gender = 2; } + this.status = Number.parseInt(`${this.str_status}`); + this.married = Number.parseInt(`${this.str_married}`); + this.idType = Number.parseInt(`${this.str_idType}`); } } diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/access/group-members/group-members.component.html b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/access/group-members/group-members.component.html index 61dece466..a01730ac3 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/access/group-members/group-members.component.html +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/access/group-members/group-members.component.html @@ -81,7 +81,9 @@
+ nzDanger>{{ + 'mxk.text.delete' | i18n + }}
diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/access/groups/groups.component.html b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/access/groups/groups.component.html index 83fcbf1d3..bee7583f9 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/access/groups/groups.component.html +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/access/groups/groups.component.html @@ -59,12 +59,9 @@ {{ data.description }}
- - +
diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/access/privileges/privileges.component.html b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/access/privileges/privileges.component.html index 246ab103e..29f5ebf75 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/access/privileges/privileges.component.html +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/access/privileges/privileges.component.html @@ -105,8 +105,7 @@
-
diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/accounts/accounts.component.html b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/accounts/accounts.component.html index d223e19cf..6f4bf7309 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/accounts/accounts.component.html +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/accounts/accounts.component.html @@ -73,16 +73,23 @@ {{ data.displayName }} {{ data.appName }} {{ data.relatedUsername }} - + + + +
- - + +
diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/accounts/accounts.component.ts b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/accounts/accounts.component.ts index 17f84f84c..806201298 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/accounts/accounts.component.ts +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/accounts/accounts.component.ts @@ -194,6 +194,19 @@ export class AccountsComponent implements OnInit { }); } + onUpdateStatus(e: MouseEvent, accountId: String, status: number): void { + e.preventDefault(); + this.accountsService.updateStatus({ id: accountId, status: status }).subscribe(res => { + if (res.code == 0) { + this.msg.success(`提交成功`); + this.fetch(); + } else { + this.msg.success(`提交失败`); + } + this.cdr.detectChanges(); + }); + } + fetch(): void { this.query.submitLoading = true; this.query.tableLoading = true; diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/apps/apps.component.html b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/apps/apps.component.html index a0c5bac70..56b0cff97 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/apps/apps.component.html +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/apps/apps.component.html @@ -130,12 +130,10 @@ style="color: green">
- -
diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/accounts-strategy/accounts-strategy.component.html b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/accounts-strategy/accounts-strategy.component.html index d8b976f3f..c5d084639 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/accounts-strategy/accounts-strategy.component.html +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/accounts-strategy/accounts-strategy.component.html @@ -64,12 +64,9 @@ style="color: green">
- - +
diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/adapters/adapters.component.html b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/adapters/adapters.component.html index 975af30d2..5fc0ae045 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/adapters/adapters.component.html +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/adapters/adapters.component.html @@ -60,12 +60,9 @@ {{ data.description }}
- - +
diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/ldap-context/ldap-context.component.html b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/ldap-context/ldap-context.component.html index e0cd56689..5816acc82 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/ldap-context/ldap-context.component.html +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/ldap-context/ldap-context.component.html @@ -66,7 +66,7 @@ name="credentials" id="credentials" /> - + {{ 'mxk.ldapcontext.basedn' | i18n }} @@ -74,7 +74,7 @@ id="basedn" /> - + {{ 'mxk.ldapcontext.filters' | i18n }} diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/socials-provider/socials-provider.component.html b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/socials-provider/socials-provider.component.html index c848fec75..3542fe18c 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/socials-provider/socials-provider.component.html +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/socials-provider/socials-provider.component.html @@ -63,12 +63,9 @@ style="color: green">
- - +
diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/synchronizers/synchronizer-editer/synchronizer-editer.component.html b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/synchronizers/synchronizer-editer/synchronizer-editer.component.html index 543027345..096897e94 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/synchronizers/synchronizer-editer/synchronizer-editer.component.html +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/synchronizers/synchronizer-editer/synchronizer-editer.component.html @@ -4,11 +4,13 @@ {{ 'mxk.text.id' | i18n }} - + - {{ 'mxk.synchronizers.sourceType' | i18n }} + {{ 'mxk.synchronizers.sourceType' | i18n }} + @@ -20,128 +22,130 @@ - {{ 'mxk.synchronizers.service' | i18n }} + {{ 'mxk.synchronizers.service' | i18n }} + - + {{ 'mxk.synchronizers.scheduler' | i18n }} - + - - {{ 'mxk.synchronizers.providerUrl' | i18n }} + "> + {{ 'mxk.synchronizers.providerUrl' | i18n }} + - + - {{ 'mxk.synchronizers.principal' | i18n }} + {{ 'mxk.synchronizers.principal' | i18n }} + - + - {{ 'mxk.synchronizers.credentials' | i18n }} + {{ 'mxk.synchronizers.credentials' | i18n }} + - + - {{ 'mxk.synchronizers.basedn' | i18n }} + {{ 'mxk.synchronizers.basedn' | i18n }} + - + - + {{ 'mxk.synchronizers.filters' | i18n }} - + - {{ 'mxk.synchronizers.msadDomain' | i18n }} + {{ 'mxk.synchronizers.msadDomain' | i18n }} + - + {{ 'mxk.synchronizers.sslSwitch' | i18n }} - + - {{ 'mxk.synchronizers.trustStore' | i18n }} + {{ 'mxk.synchronizers.trustStore' | i18n }} + - + - {{ 'mxk.synchronizers.trustStorePassword' | i18n }} + {{ 'mxk.synchronizers.trustStorePassword' | i18n + }} - + - {{ 'mxk.synchronizers.syncStartTime' | i18n }} - - + {{ 'mxk.synchronizers.syncStartTime' | i18n }} + + + - {{ 'mxk.synchronizers.resumeTime' | i18n }} + {{ 'mxk.synchronizers.resumeTime' | i18n }} + - + - {{ 'mxk.synchronizers.suspendTime' | i18n }} + {{ 'mxk.synchronizers.suspendTime' | i18n }} + - + {{ 'mxk.text.status' | i18n }} - + @@ -152,4 +156,4 @@
-
+ \ No newline at end of file diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/synchronizers/synchronizers.component.html b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/synchronizers/synchronizers.component.html index 0226d3abf..570660f99 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/synchronizers/synchronizers.component.html +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/config/synchronizers/synchronizers.component.html @@ -60,16 +60,11 @@ style="color: green">
- - - + +
diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/organizations/organizations.component.html b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/organizations/organizations.component.html index a5be892e0..22181995b 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/organizations/organizations.component.html +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/organizations/organizations.component.html @@ -82,12 +82,10 @@ style="color: green">
- -
diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/permissions/resources/resources.component.html b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/permissions/resources/resources.component.html index a90863036..0b4327d59 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/permissions/resources/resources.component.html +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/permissions/resources/resources.component.html @@ -99,12 +99,9 @@ style="color: green">
- - +
diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/permissions/role-members/role-members.component.html b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/permissions/role-members/role-members.component.html index d6b62da87..d379bec34 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/permissions/role-members/role-members.component.html +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/permissions/role-members/role-members.component.html @@ -81,7 +81,9 @@
+ nzDanger>{{ + 'mxk.text.delete' | i18n + }}
diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/permissions/roles/roles.component.html b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/permissions/roles/roles.component.html index 437588200..4e1488f18 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/permissions/roles/roles.component.html +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/permissions/roles/roles.component.html @@ -59,12 +59,9 @@ {{ data.description }}
- - +
diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/routes-routing.module.ts b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/routes-routing.module.ts index 44f7f6b8b..8db815b91 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/routes-routing.module.ts +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/routes-routing.module.ts @@ -1,19 +1,18 @@ /* * Copyright [2022] [MaxKey of copyright http://www.maxkey.top] - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ - import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/routes.module.ts b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/routes.module.ts index 2b662675a..74cba4182 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/routes.module.ts +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/routes.module.ts @@ -36,6 +36,7 @@ import { RouteRoutingModule } from './routes-routing.module'; import { SelectUserComponent } from './users/select-user/select-user.component'; import { UserEditerComponent } from './users/user-editer/user-editer.component'; import { UsersComponent } from './users/users.component'; +import { PasswordComponent } from './users/password/password.component'; const COMPONENTS: Array> = []; @@ -59,7 +60,8 @@ const COMPONENTS: Array> = []; AppSaml20DetailsEditerComponent, AppTokenBasedDetailsEditerComponent, AppExtendApiDetailsEditerComponent, - AppBasicDetailsEditerComponent + AppBasicDetailsEditerComponent, + PasswordComponent ] }) export class RoutesModule { } diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/users/password/password.component.html b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/users/password/password.component.html new file mode 100644 index 000000000..338861e65 --- /dev/null +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/users/password/password.component.html @@ -0,0 +1,62 @@ +
{{ 'mxk.text.changepassword' | i18n }}
+
+
+ + {{ 'mxk.password.id' | i18n }} + + + + + + {{ 'mxk.password.username' | i18n }} + + + + + + + {{ 'mxk.password.displayName' | i18n }} + + + + + + + {{ 'mxk.password.password' | i18n }} + + + + + + + + + + + + + + + {{ 'mxk.password.confirmPassword' | + i18n }} + + + + +
+
+ +
+ + +
\ No newline at end of file diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/users/password/password.component.less b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/users/password/password.component.less new file mode 100644 index 000000000..e69de29bb diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/users/password/password.component.spec.ts b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/users/password/password.component.spec.ts new file mode 100644 index 000000000..5bbde294b --- /dev/null +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/users/password/password.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PasswordComponent } from './password.component'; + +describe('PasswordComponent', () => { + let component: PasswordComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ PasswordComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(PasswordComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/users/password/password.component.ts b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/users/password/password.component.ts new file mode 100644 index 000000000..3d9a3da5e --- /dev/null +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/users/password/password.component.ts @@ -0,0 +1,75 @@ +import { Component, ChangeDetectorRef, OnInit, Input } from '@angular/core'; +import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'; + +import { ChangePassword } from '../../../entity/ChangePassword'; +import { PasswordService } from '../../../service/password.service'; +import { UsersService } from '../../../service/users.service'; + +@Component({ + selector: 'app-password', + templateUrl: './password.component.html', + styleUrls: ['./password.component.less'] +}) +export class PasswordComponent implements OnInit { + @Input() id?: String; + @Input() username?: String; + @Input() displayName?: String; + + form: { + submitting: boolean; + model: ChangePassword; + } = { + submitting: false, + model: new ChangePassword() + }; + + passwordVisible: boolean = false; + + formGroup: FormGroup = new FormGroup({}); + + constructor( + private usersService: UsersService, + private passwordService: PasswordService, + private modalRef: NzModalRef, + private fb: FormBuilder, + private msg: NzMessageService, + private cdr: ChangeDetectorRef + ) { } + + ngOnInit(): void { + this.form.model.id = this.id || ''; + this.form.model.userId = this.id || ''; + this.form.model.username = this.username || ''; + this.form.model.displayName = this.displayName || ''; + } + + onPassword(e: MouseEvent): void { + e.preventDefault(); + this.usersService.generatePassword({}).subscribe(res => { + this.form.model.password = res.data; + this.form.model.confirmPassword = res.data; + this.cdr.detectChanges(); + }); + } + + onClose(e: MouseEvent): void { + e.preventDefault(); + this.modalRef.destroy({ refresh: false }); + } + + onSubmit(e: MouseEvent): void { + e.preventDefault(); + this.form.submitting = true; + this.passwordService.changePassword(this.form.model).subscribe(res => { + if (res.code == 0) { + this.msg.success(`提交成功`); + } else { + this.msg.success(`提交失败`); + } + this.modalRef.destroy({ refresh: true }); + this.cdr.detectChanges(); + }); + } +} diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/users/user-editer/user-editer.component.html b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/users/user-editer/user-editer.component.html index 6bb9fe2ad..313620864 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/users/user-editer/user-editer.component.html +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/users/user-editer/user-editer.component.html @@ -7,53 +7,45 @@ {{ 'mxk.text.id' | i18n }} - - + +
- {{ 'mxk.users.displayName' | i18n }} - - + {{ 'mxk.users.displayName' | i18n }} + + +
- {{ 'mxk.users.username' | i18n }} - - + {{ 'mxk.users.username' | i18n }} + + +
- {{ 'mxk.users.password' | i18n }} - - + {{ 'mxk.users.password' | i18n }} + + +
{{ 'mxk.users.gender' | i18n }} - + @@ -64,21 +56,15 @@ {{ 'mxk.users.picture' | i18n }}
- +
Upload
- + @@ -88,85 +74,99 @@
- {{ 'mxk.users.employeeNumber' | i18n }} - - + {{ 'mxk.users.employeeNumber' | i18n }} + + + - {{ 'mxk.users.windowsAccount' | i18n }} + {{ 'mxk.users.windowsAccount' | i18n }} + - +
{{ 'mxk.users.mobile' | i18n }} - - + + {{ 'mxk.users.email' | i18n }} - +
- {{ 'mxk.users.userType' | i18n }} - - + {{ 'mxk.users.userType' | i18n }} + + + + + + + + + + + + + - {{ 'mxk.users.userstate' | i18n }} - - + {{ 'mxk.users.userstate' | i18n }} + + + + + + + +
- {{ 'mxk.text.sortIndex' | i18n }} - - + {{ 'mxk.text.sortIndex' | i18n }} + + + - {{ 'mxk.text.status' | i18n }} - - + {{ 'mxk.text.status' | i18n }} + + + + + + + +
@@ -176,25 +176,15 @@ {{ 'mxk.users.familyName' | i18n }} - + {{ 'mxk.users.middleName' | i18n }} - +
@@ -202,13 +192,15 @@ {{ 'mxk.users.givenName' | i18n }} - + {{ 'mxk.users.nickName' | i18n }} - + @@ -216,13 +208,21 @@ {{ 'mxk.users.idtype' | i18n }} - + + + + + + + {{ 'mxk.users.idCardNo' | i18n }} - + @@ -230,39 +230,39 @@ {{ 'mxk.users.married' | i18n }} - + + + + + + + {{ 'mxk.users.birthDate' | i18n }} - +
- {{ 'mxk.users.preferredLanguage' | i18n }} + {{ 'mxk.users.preferredLanguage' | i18n }} + - + - {{ 'mxk.users.startWorkDate' | i18n }} + {{ 'mxk.users.startWorkDate' | i18n }} + - +
@@ -270,13 +270,15 @@ {{ 'mxk.users.website' | i18n }} - + {{ 'mxk.users.ims' | i18n }} - + @@ -284,115 +286,112 @@
- {{ 'mxk.users.organization' | i18n }} - - + {{ 'mxk.users.organization' | i18n }} + + + {{ 'mxk.users.division' | i18n }} - - + +
- {{ 'mxk.users.departmentId' | i18n }} - - + {{ 'mxk.users.departmentId' | i18n }} + + + {{ 'mxk.users.department' | i18n }} - - + +
{{ 'mxk.users.costCenter' | i18n }} - - + + {{ 'mxk.users.jobLevel' | i18n }} - - + +
{{ 'mxk.users.jobTitle' | i18n }} - - + + {{ 'mxk.users.manager' | i18n }} - - + +
{{ 'mxk.users.assistant' | i18n }} - - + + - {{ 'mxk.users.workOfficeName' | i18n }} - - + {{ 'mxk.users.workOfficeName' | i18n }} + + +
{{ 'mxk.users.entryDate' | i18n }} - - + + {{ 'mxk.users.quitDate' | i18n }} - - + +
@@ -400,81 +399,77 @@
- {{ 'mxk.users.workPhoneNumber' | i18n }} - - + {{ 'mxk.users.workPhoneNumber' | i18n }} + + + {{ 'mxk.users.workEmail' | i18n }} - - + +
- {{ 'mxk.users.workCountry' | i18n }} - - + {{ 'mxk.users.workCountry' | i18n }} + + + {{ 'mxk.users.workRegion' | i18n }} - - + +
{{ 'mxk.users.workLocality' | i18n }} - - + + - {{ 'mxk.users.workStreetAddress' | i18n }} - - + {{ 'mxk.users.workStreetAddress' | i18n }} + + +
- {{ 'mxk.users.workPostalCode' | i18n }} - - + {{ 'mxk.users.workPostalCode' | i18n }} + + + {{ 'mxk.users.workFax' | i18n }} - - + +
@@ -483,80 +478,76 @@
{{ 'mxk.users.homeEmail' | i18n }} - - + + - {{ 'mxk.users.homePhoneNumber' | i18n }} - - + {{ 'mxk.users.homePhoneNumber' | i18n }} + + +
{{ 'mxk.users.homeFax' | i18n }} - - + + - {{ 'mxk.users.homePostalCode' | i18n }} - - + {{ 'mxk.users.homePostalCode' | i18n }} + + +
- {{ 'mxk.users.homeCountry' | i18n }} - - + {{ 'mxk.users.homeCountry' | i18n }} + + + {{ 'mxk.users.homeRegion' | i18n }} - - + +
{{ 'mxk.users.homeLocality' | i18n }} - - + + - {{ 'mxk.users.homeStreetAddress' | i18n }} - - + {{ 'mxk.users.homeStreetAddress' | i18n }} + + +
@@ -569,4 +560,4 @@
-
+ \ No newline at end of file diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/users/users.component.html b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/users/users.component.html index 07c1cd923..a49e6d2ac 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/users/users.component.html +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/users/users.component.html @@ -26,10 +26,15 @@
- - + + +
- - + + + +
    +
  • {{ + 'mxk.text.changepassword' | i18n + }}
  • +
  • {{ + 'mxk.text.lock' | i18n }}
  • +
  • {{ + 'mxk.text.disable' | i18n + }}
  • +
  • {{ + 'mxk.text.enable' | i18n + }}
  • +
  • {{ + 'mxk.text.unlock' | i18n + }}
  • +
  • {{ 'mxk.text.delete' | i18n }}
  • +
+
diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/users/users.component.ts b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/users/users.component.ts index b0da20a21..48589250a 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/users/users.component.ts +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/users/users.component.ts @@ -1,19 +1,18 @@ /* * Copyright [2022] [MaxKey of copyright http://www.maxkey.top] - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ - import { ChangeDetectionStrategy, ViewContainerRef, ChangeDetectorRef, Component, OnInit } from '@angular/core'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; @@ -32,6 +31,7 @@ import { TreeNodes } from '../../entity/TreeNodes'; import { OrganizationsService } from '../../service/organizations.service'; import { UsersService } from '../../service/users.service'; import { set2String } from '../../shared/index'; +import { PasswordComponent } from './password/password.component'; import { UserEditerComponent } from './user-editer/user-editer.component'; @Component({ @@ -127,6 +127,50 @@ export class UsersComponent implements OnInit { }); } + changePassword(e: MouseEvent): void { + e.preventDefault(); + let lastCheckedId: String = ''; + this.query.tableCheckedId.forEach(value => { + lastCheckedId = value; + }); + for (var i = 0; i < this.query.results.rows.length; i++) { + let user = this.query.results.rows[i]; + if (lastCheckedId == user.id) { + const modal = this.modal.create({ + nzContent: PasswordComponent, + nzViewContainerRef: this.viewContainerRef, + nzComponentParams: { + id: user.id, + username: user.username, + displayName: user.displayName + }, + nzWidth: 450, + nzOnOk: () => new Promise(resolve => setTimeout(resolve, 1000)) + }); + } + } + } + + changePasswordById(e: MouseEvent, userId: String): void { + e.preventDefault(); + for (var i = 0; i < this.query.results.rows.length; i++) { + let user = this.query.results.rows[i]; + if (userId == user.id) { + const modal = this.modal.create({ + nzContent: PasswordComponent, + nzViewContainerRef: this.viewContainerRef, + nzComponentParams: { + id: user.id, + username: user.username, + displayName: user.displayName + }, + nzWidth: 450, + nzOnOk: () => new Promise(resolve => setTimeout(resolve, 1000)) + }); + } + } + } + onAdd(e: MouseEvent): void { e.preventDefault(); const modal = this.modal.create({ @@ -169,6 +213,19 @@ export class UsersComponent implements OnInit { }); } + onUpdateStatus(e: MouseEvent, userId: String, status: number): void { + e.preventDefault(); + this.usersService.updateStatus({ id: userId, status: status }).subscribe(res => { + if (res.code == 0) { + this.msg.success(`提交成功`); + this.fetch(); + } else { + this.msg.success(`提交失败`); + } + this.cdr.detectChanges(); + }); + } + onDelete(e: MouseEvent, deleteId: String): void { e.preventDefault(); this.usersService.delete(deleteId).subscribe(res => { diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/service/accounts.service.ts b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/service/accounts.service.ts index d7a82f1ec..42ffa1fef 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/service/accounts.service.ts +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/service/accounts.service.ts @@ -1,19 +1,18 @@ /* * Copyright [2022] [MaxKey of copyright http://www.maxkey.top] - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ - import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; @@ -35,4 +34,10 @@ export class AccountsService extends BaseService { generate(params: NzSafeAny): Observable> { return this.getByParams(params, `${this.server.urls.base}/generate`); } + + updateStatus(params: NzSafeAny): Observable> { + return this.http.get>(`${this.server.urls.base}/updateStatus`, { + params: this.parseParams(params) + }); + } } diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/service/password.service.ts b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/service/password.service.ts new file mode 100644 index 000000000..1acb76859 --- /dev/null +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/service/password.service.ts @@ -0,0 +1,37 @@ +/* + * Copyright [2022] [MaxKey of copyright http://www.maxkey.top] + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { HttpClient, HttpParams } from '@angular/common/http'; +import { Injectable } from '@angular/core'; +import { NzSafeAny } from 'ng-zorro-antd/core/types'; +import { Observable } from 'rxjs'; + +import { ChangePassword } from '../entity/ChangePassword'; +import { Message } from '../entity/Message'; +import { BaseService } from './base.service'; + +@Injectable({ + providedIn: 'root' +}) +export class PasswordService extends BaseService { + constructor(private _httpClient: HttpClient) { + super(_httpClient, '/config'); + } + + public changePassword(body: NzSafeAny): Observable> { + return this.http.put>('/users/changePassword', body); + } +} diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/service/users.service.ts b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/service/users.service.ts index a821f8d94..922158a9d 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/service/users.service.ts +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/service/users.service.ts @@ -1,19 +1,18 @@ /* * Copyright [2022] [MaxKey of copyright http://www.maxkey.top] - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ - import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; @@ -37,4 +36,10 @@ export class UsersService extends BaseService { params: this.parseParams(params) }); } + + updateStatus(params: NzSafeAny): Observable> { + return this.http.get>(`${this.server.urls.base}/updateStatus`, { + params: this.parseParams(params) + }); + } } diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/shared/utils/set2stringstil.ts b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/shared/utils/set2stringstil.ts index 2316f9183..f779b3fcd 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/shared/utils/set2stringstil.ts +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/shared/utils/set2stringstil.ts @@ -1,19 +1,18 @@ /* * Copyright [2022] [MaxKey of copyright http://www.maxkey.top] - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ - export function set2String(set: Set): string { let setValues = ''; diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/assets/i18n/en-US.json b/maxkey-web-frontend/maxkey-web-mgt-app/src/assets/i18n/en-US.json index 71beb4d6f..7d35fb459 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/assets/i18n/en-US.json +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/assets/i18n/en-US.json @@ -549,6 +549,15 @@ "resumeTime":"Join Time", "suspendTime":"Suspend Time" }, + "password":{ + "id": "Id", + "displayName": "DisplayName", + "username": "Username", + "oldPassword": "Old Password", + "password": "New Password", + "confirmPassword": "Confirm Password", + "captcha": "Captcha" + }, "smsprovider" :{ "provider": "provider", "name":{ @@ -631,6 +640,7 @@ "manual":"Manual", "automatic":"Automatic", "terminate":"Terminate", + "changepassword": "ChangePassword", "add": "Add", "edit": "Edit", "delete": "Delete", @@ -638,6 +648,11 @@ "confirm":"Confirm", "synchr":"Synchr", "close":"Close", + "enable":"Enable", + "disable":"Disable", + "lock":"Lock", + "unlock":"UnLock", + "moreaction":"More", "submit":"Submit", "generate":"Generate", "upload":"Upload", diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/assets/i18n/zh-CN.json b/maxkey-web-frontend/maxkey-web-mgt-app/src/assets/i18n/zh-CN.json index 3a3c8ccc4..091e618b0 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/assets/i18n/zh-CN.json +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/assets/i18n/zh-CN.json @@ -88,7 +88,7 @@ "displayName":"姓名", "username":"登录账号", "password":"密码", - "email":"邮箱", + "email":"电子邮箱", "mobile":"手机号码", "userType":"用户类型", "userType.employee":"内部员工", @@ -548,6 +548,15 @@ "resumeTime":"执行时间", "suspendTime":"挂起时间" }, + "password":{ + "id": "用户编码", + "displayName": "姓名", + "username": "账号", + "oldPassword": "当前密码", + "password": "新密码", + "confirmPassword": "确认密码", + "captcha": "验证码" + }, "smsprovider" :{ "provider": "提供商", "name":{ @@ -630,6 +639,7 @@ "manual":"人工", "automatic":"自动", "terminate":"终止", + "changepassword": "密码修改", "add": "新增", "edit": "编辑", "delete": "删除", @@ -637,7 +647,12 @@ "confirm":"确定", "synchr":"同步", "close":"关闭", + "enable":"启用", + "disable":"禁用", + "lock":"锁定", + "unlock":"解锁", "submit":"提交", + "moreaction":"更多", "generate":"生成", "upload":"上传", "save":"保存", diff --git a/maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/contorller/AccountsController.java b/maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/contorller/AccountsController.java index 9534e1cb2..835a6c17b 100644 --- a/maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/contorller/AccountsController.java +++ b/maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/contorller/AccountsController.java @@ -113,6 +113,19 @@ public class AccountsController { } } + + @RequestMapping(value = { "/updateStatus" }, produces = {MediaType.APPLICATION_JSON_VALUE}) + @ResponseBody + public ResponseEntity updateStatus(@ModelAttribute Accounts accounts,@CurrentUser UserInfo currentUser) { + _logger.debug(""+accounts); + accounts.setInstId(currentUser.getInstId()); + if (accountsService.updateStatus(accounts)) { + return new Message(Message.SUCCESS).buildResponse(); + } else { + return new Message(Message.FAIL).buildResponse(); + } + } + @ResponseBody @RequestMapping(value={"/delete"}, produces = {MediaType.APPLICATION_JSON_VALUE}) public ResponseEntity delete(@RequestParam("ids") String ids,@CurrentUser UserInfo currentUser) { diff --git a/maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/contorller/UserInfoController.java b/maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/contorller/UserInfoController.java index c55d78518..fd19ed84b 100644 --- a/maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/contorller/UserInfoController.java +++ b/maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/contorller/UserInfoController.java @@ -185,7 +185,7 @@ public class UserInfoController { @ResponseBody @RequestMapping(value="/changePassword", produces = {MediaType.APPLICATION_JSON_VALUE}) public ResponseEntity changePassword( - @ModelAttribute ChangePassword changePassword, + @RequestBody ChangePassword changePassword, @CurrentUser UserInfo currentUser) { _logger.debug("UserId {}",changePassword.getUserId()); changePassword.setPasswordSetType(ConstsPasswordSetType.PASSWORD_NORMAL); @@ -197,6 +197,18 @@ public class UserInfoController { } } + @RequestMapping(value = { "/updateStatus" }, produces = {MediaType.APPLICATION_JSON_VALUE}) + @ResponseBody + public ResponseEntity updateStatus(@ModelAttribute UserInfo userInfo,@CurrentUser UserInfo currentUser) { + _logger.debug(""+userInfo); + userInfo.setInstId(currentUser.getInstId()); + if(userInfoService.updateStatus(userInfo)) { + return new Message(Message.SUCCESS).buildResponse(); + } else { + return new Message(Message.FAIL).buildResponse(); + } + } + @RequestMapping(value = "/import") public ResponseEntity importingUsers( @ModelAttribute("excelImportFile")ExcelImport excelImportFile,