fix(auth): 解决非手机号注册用户查询异常及自动登录接口配置问题

- 在AppInfoSetController中添加空值检查,抛出业务异常提示非手机号注册用户需联系管理员
- 修改AuthController中自动登录接口为POST方法并更新相关参数配置
- 更新用户权限类型参数验证范围从0-2扩展到0-3以支持更多权限类型
This commit is contained in:
xy
2026-06-26 15:22:56 +08:00
parent e2e7669d47
commit 709262c2b4
3 changed files with 12 additions and 9 deletions

View File

@@ -62,7 +62,7 @@ public class UserParam {
@ApiModelProperty("用户权限类型")
@NotNull(message = UserValidMessage.CASUAL_USER_NOT_BLANK)
@Range(min = 0, max = 2, message = UserValidMessage.PARAM_FORMAT_ERROR)
@Range(min = 0, max = 3, message = UserValidMessage.PARAM_FORMAT_ERROR)
private Integer type;
@ApiModelProperty("短信通知")

View File

@@ -4,6 +4,7 @@ package com.njcn.user.controller.app;
import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.user.pojo.param.AppInfoSetParam;
@@ -23,6 +24,7 @@ import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
import java.util.Objects;
/**
* <p>
@@ -58,6 +60,9 @@ public class AppInfoSetController extends BaseController {
public HttpResult<AppInfoSet> queryByUserId(){
String methodDescribe = getMethodDescribe("queryByUserId");
AppInfoSet appInfoSet = appInfoSetService.lambdaQuery().eq(AppInfoSet::getUserId, RequestUtil.getUserIndex()).one();
if (Objects.isNull(appInfoSet)) {
throw new BusinessException("非手机号注册的用户,需联系管理员添加配置!");
}
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, appInfoSet, methodDescribe);
}