|
@@ -31,6 +31,7 @@ import org.jeecg.modules.system.service.impl.SysBaseApiImpl;
|
|
|
import org.jeecg.modules.system.util.RandImageUtil;
|
|
import org.jeecg.modules.system.util.RandImageUtil;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
@@ -47,6 +48,10 @@ import java.util.*;
|
|
|
@Api(tags="用户登录")
|
|
@Api(tags="用户登录")
|
|
|
@Slf4j
|
|
@Slf4j
|
|
|
public class LoginController {
|
|
public class LoginController {
|
|
|
|
|
+
|
|
|
|
|
+ @Value("${password.initial}")
|
|
|
|
|
+ private String password;
|
|
|
|
|
+
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private ISysUserService sysUserService;
|
|
private ISysUserService sysUserService;
|
|
|
|
|
|
|
@@ -195,7 +200,8 @@ public class LoginController {
|
|
|
queryWrapper.eq(SysUser::getUsername,user.getUsername());
|
|
queryWrapper.eq(SysUser::getUsername,user.getUsername());
|
|
|
SysUser sysUser = sysUserService.getOne(queryWrapper);
|
|
SysUser sysUser = sysUserService.getOne(queryWrapper);
|
|
|
String encryptNew = PasswordUtil.encrypt(user.getUsername(), user.getPassword(), sysUser.getSalt());
|
|
String encryptNew = PasswordUtil.encrypt(user.getUsername(), user.getPassword(), sysUser.getSalt());
|
|
|
- String encryptOld = PasswordUtil.encrypt(user.getUsername(), "tncBeiqu.123", sysUser.getSalt());
|
|
|
|
|
|
|
+ //初始密码
|
|
|
|
|
+ String encryptOld = PasswordUtil.encrypt(user.getUsername(), password, sysUser.getSalt());
|
|
|
if (encryptNew.equals(encryptOld)|| sysUser.getUpdateTime()==null){
|
|
if (encryptNew.equals(encryptOld)|| sysUser.getUpdateTime()==null){
|
|
|
return Result.error("首次登录请先修改密码...");
|
|
return Result.error("首次登录请先修改密码...");
|
|
|
}else {
|
|
}else {
|
|
@@ -754,4 +760,14 @@ public class LoginController {
|
|
|
return Result.OK(result);
|
|
return Result.OK(result);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @GetMapping("/getPassWord")
|
|
|
|
|
+ public Result<JSONObject> getPassWord() {
|
|
|
|
|
+ Result<JSONObject> result = new Result<JSONObject>();
|
|
|
|
|
+ JSONObject obj=new JSONObject();
|
|
|
|
|
+ obj.put("passWord", password);
|
|
|
|
|
+ result.setResult(obj);
|
|
|
|
|
+ result.success("");
|
|
|
|
|
+ return result;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|