diff --git a/backend/src/main/java/io/dataease/auth/server/AuthServer.java b/backend/src/main/java/io/dataease/auth/server/AuthServer.java index 3eefede2df..6e1fdafd57 100644 --- a/backend/src/main/java/io/dataease/auth/server/AuthServer.java +++ b/backend/src/main/java/io/dataease/auth/server/AuthServer.java @@ -63,6 +63,7 @@ public class AuthServer implements AuthApi { @Override public Object login(@RequestBody LoginDto loginDto) throws Exception { + Map result = new HashMap<>(); String username = RsaUtil.decryptByPrivateKey(RsaProperties.privateKey, loginDto.getUsername()); String pwd = RsaUtil.decryptByPrivateKey(RsaProperties.privateKey, loginDto.getPassword()); @@ -147,9 +148,11 @@ public class AuthServer implements AuthApi { AccountLockStatus lockStatus = authUserService.recordLoginFail(username, 0); DataEaseException.throwException(appendLoginErrorMsg(Translator.get("i18n_id_or_pwd_error"), lockStatus)); } + if(user.getIsAdmin() && user.getPassword().equals("40b8893ea9ebc2d631c4bb42bb1e8996")){ + result.put("passwordModified", false); + } } - Map result = new HashMap<>(); TokenInfo tokenInfo = TokenInfo.builder().userId(user.getUserId()).username(username).build(); String token = JWTUtils.sign(tokenInfo, realPwd); // 记录token操作时间 diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 48e6959159..2dc1dd4a5f 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -12,7 +12,7 @@ :title="$t('user.change_password')" :show-close="false" > - + diff --git a/frontend/src/store/modules/user.js b/frontend/src/store/modules/user.js index 18aca6f46a..4910519ee5 100644 --- a/frontend/src/store/modules/user.js +++ b/frontend/src/store/modules/user.js @@ -83,6 +83,9 @@ const actions = { commit('SET_TOKEN', data.token) commit('SET_LOGIN_MSG', null) setToken(data.token) + if(data.hasOwnProperty('passwordModified')){ + commit('SET_PASSWORD_MODIFIED', data.passwordModified) + } resolve() }).catch(error => { reject(error)