| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public Map<String, Object> screenLoginNew(Map<String, Object> parameters) {
|
| | | Map<String, Object> result = new HashMap<String, Object>();
|
| | | Account account = new Account();
|
| | | account.setAccountName((String) parameters.get("account"));
|
| | | String rawPassword = (String) parameters.get("password");
|
| | | // account.setPassword(encoder.encode((String) parameters.get("password")));
|
| | | account = accountMapper.selectOne(account);
|
| | | Integer existRole=accountMapper.getScreenRoleByAccountName(account.getAccountName());
|
| | | List<Menu> menuList = accountMapper.getScreenMenuListsByAccountName(account.getAccountName());
|
| | | boolean isValid = account == null ? false : encoder.matches(rawPassword, account.getPassword());
|
| | | if (!isValid) {
|
| | | result.put("msg", "用户名及密码输入错误!");
|
| | | } else {
|
| | | if (IS_DELETE_FALSE.equals(account.getIsDelete())) {
|
| | | if(existRole!=null) {
|
| | | result.put("msg", "登录成功!");
|
| | | result.put("accountId", account.getId());
|
| | | result.put("orgId", account.getOrganizationId());
|
| | | result.put("data",menuList);
|
| | | setOrgIdsByAccount(result);
|
| | | }else{
|
| | | result.put("msg", "账户没有权限!");
|
| | | }
|
| | | } else {
|
| | | result.put("msg", "您的账号已禁用,请联系管理员!");
|
| | | }
|
| | | }
|
| | | return result;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public Account getAccountByAccountName(String accountName) {
|
| | | Account account = new Account();
|
| | | account.setAccountName(accountName);
|