linhw 2024-05-29 19:49:00 +08:00
parent a3ad6227e1
commit 2535d8add3
3 changed files with 21 additions and 11 deletions

View File

@ -12,6 +12,7 @@ import com.ruoyi.app.domain.vo.AppUserVo;
import com.ruoyi.app.form.AppLoginUser;
import com.ruoyi.app.form.LoginForm;
import com.ruoyi.app.form.RegisterForm;
import com.ruoyi.app.mapper.AppRegisterMapper;
import com.ruoyi.app.service.IAppRegisterService;
import com.ruoyi.app.service.IAppSchoolService;
import com.ruoyi.app.service.IAppUserService;
@ -67,6 +68,9 @@ public class AppLoginController {
@Autowired
private TokenService tokenService;
@Autowired
private AppRegisterMapper appRegisterMapper;
public static void main(String[] args) {
String str = "2@qq.com";
System.out.println(IdUtils.fastUUID());
@ -252,18 +256,17 @@ public class AppLoginController {
public String activation(@PathVariable String token, @PathVariable String email) {
RegisterForm cacheMap = redisService.getCacheObject(token);
if (email.equals(cacheMap.getEmail())) {
/* AppRegister appRegister = (AppRegister) cacheMap.getEmail();
appRegister.setStatus(1);
appRegisterService.updateAppRegister(appRegister);*/
/*AppRegister appRegister = appRegisterService.selectAppRegisterByEmail(email);
AppUser appUser = new AppUser();
BeanUtils.copyBeanProp(appUser, appRegister);
appUserService.insertAppUser(appUser);*/
AppRegister appRegister = appRegisterMapper.selectAppRegisterByEmail(cacheMap.getEmail());
if (appRegister != null) {
AppRegister entity = new AppRegister();
entity.setId(appRegister.getId());
appRegister.setStatus(1);
appRegisterService.updateAppRegister(entity);
AppUser appUser = new AppUser();
BeanUtils.copyBeanProp(appUser, appRegister);
appUserService.insertAppUser(appUser);
}
}
redisService.deleteObject(token);
return "<!DOCTYPE html>\n" +
"<html>\n" +

View File

@ -63,6 +63,9 @@ public interface AppRegisterMapper
AppRegister selectAppRegisterByphone(@Param("phoneNumber")
String phoneNumber);
AppRegister selectAppRegisterByEmail(@Param("email")
String email);
int updateAppRegisterByPhone(AppRegister appRegister);
long selectAppRegisterCount(AppRegister appRegister);

View File

@ -149,6 +149,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select * from app_register where phone = #{phoneNumber}
</select>
<select id="selectAppRegisterByEmail" resultType="com.ruoyi.app.domain.AppRegister">
select * from app_register where email = #{email} limit 1
</select>
<update id="updateAppRegisterByPhone">
update app_register
<trim prefix="SET" suffixOverrides=",">