This commit is contained in:
zhouwentao 2024-08-18 17:49:41 +08:00
parent 6e742a8e06
commit 724c7ef504
1 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,7 @@
package org.jeecg.modules.web.service;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.constant.CommonConstant;
@ -46,8 +47,9 @@ public class WebUserService {
String username = sysLoginModel.getUsername();
String password = sysLoginModel.getPassword();
AssertUtils.notNull(username, "手机号不可为空");
AssertUtils.notNull(username, "密码不可为空");
SysUser sysUser = sysUserService.getUserByPhone(username);
AssertUtils.notNull(password, "密码不可为空");
AssertUtils.notNull(sysLoginModel.getProgramType(), "请求参数有误");
SysUser sysUser = sysUserService.getOne(new LambdaQueryWrapper<SysUser>().eq(SysUser::getPhone, username).eq(SysUser::getProgramType, sysLoginModel.getProgramType()));
AssertUtils.notNull(sysUser,"手机号或密码错误");
//2. 校验用户名或密码是否正确
String userpassword = PasswordUtil.encrypt(sysUser.getUsername(), password, sysUser.getSalt());