|
|
|
@ -12,6 +12,10 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.luoo.user.dto.request.*;
|
|
|
|
|
import com.luoo.user.service.WeChatAouth2Service;
|
|
|
|
|
import com.luoo.user.util.IOSTokenUtils;
|
|
|
|
|
import constants.ErrorConstants;
|
|
|
|
|
import enums.UserStatusEnum;
|
|
|
|
|
import exception.BizException;
|
|
|
|
|
import org.apache.commons.lang.ObjectUtils;
|
|
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
|
|
@ -372,6 +376,10 @@ public class LoginController extends BaseController {
|
|
|
|
|
@PostMapping("/login/{userName}/{password}")
|
|
|
|
|
public Result loginByUserName(@PathVariable String userName, @PathVariable String password) {
|
|
|
|
|
UserInfo userInfo = userInfoService.findByUserNameAndPassword(userName, password);
|
|
|
|
|
if(ObjectUtils.notEqual(UserStatusEnum.ENABLE.getStatus(), userInfo.getStatus())){
|
|
|
|
|
// 用户状态错误
|
|
|
|
|
throw new BizException(ErrorConstants.USER_STATUS_ERROR);
|
|
|
|
|
}
|
|
|
|
|
if (userInfo !=null) {
|
|
|
|
|
//生成token
|
|
|
|
|
String token = jwtUtil.createJWT(userInfo.getId(),userInfo.getUserName(),"artist","");
|
|
|
|
|