| | |
| | | import com.zy.asrs.common.properties.SystemProperties; |
| | | import com.zy.asrs.common.sys.entity.*; |
| | | import com.zy.asrs.common.sys.service.*; |
| | | import com.zy.asrs.common.timer.LicenseTimer; |
| | | import com.zy.asrs.common.utils.RandomValidateCodeUtil; |
| | | import com.zy.asrs.framework.annotations.ManagerAuth; |
| | | import com.zy.asrs.framework.common.AesUtils; |
| | |
| | | private HostService hostService; |
| | | @Autowired |
| | | private ConfigService configService; |
| | | @Autowired |
| | | private LicenseTimer licenseTimer; |
| | | |
| | | @RequestMapping("/login.action") |
| | | @ManagerAuth(value = ManagerAuth.Auth.NONE, memo = "登录") |
| | | public R loginAction(String username, String password, Boolean wms) { |
| | | if (!licenseTimer.getSystemSupport()) {//许可证已失效 |
| | | return R.parse(CodeRes.SYSTEM_20001); |
| | | } |
| | | if (username.equals("super") && password.equals(Cools.md5(superPwd))) { |
| | | Map<String, Object> res = new HashMap<>(); |
| | | res.put("username", username); |
| | |
| | | return R.parse(CodeRes.USER_10003); |
| | | } |
| | | String system = null;//登陆系统 |
| | | if (wms) { |
| | | if (wms != null && wms) { |
| | | system = String.valueOf(LoginSystemType.WMS); |
| | | }else { |
| | | } else { |
| | | system = String.valueOf(LoginSystemType.WCS); |
| | | } |
| | | String token = Cools.enToken(System.currentTimeMillis() + username, user.getPassword()); |