商户登录相关
This commit is contained in:
@@ -18,7 +18,15 @@
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.github.whvcse</groupId>
|
||||
<artifactId>easy-captcha</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.czg</groupId>
|
||||
<artifactId>cash-common-tools</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.czg.dto;
|
||||
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
|
||||
public record SysLoginDTO(
|
||||
@NotEmpty(message = "用户名不为空")
|
||||
String username,
|
||||
@NotEmpty(message = "密码不为空")
|
||||
String password,
|
||||
@NotEmpty(message = "验证码不为空")
|
||||
String code,
|
||||
@NotEmpty(message = "uid不为空")
|
||||
String uuid,
|
||||
String staffName
|
||||
) {
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.czg.service;
|
||||
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
*/
|
||||
public interface AuthorizationService {
|
||||
Object getCaptcha();
|
||||
|
||||
Object login(com.czg.dto.SysLoginDTO loginDTO);
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.czg.service.impl;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.czg.dto.SysLoginDTO;
|
||||
import com.czg.service.AuthorizationService;
|
||||
import com.wf.captcha.SpecCaptcha;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
*/
|
||||
@Service
|
||||
public class AuthorizationServiceImpl implements AuthorizationService {
|
||||
@Override
|
||||
public Object getCaptcha() {
|
||||
// 生成验证码(130x48,4位字符)
|
||||
SpecCaptcha captcha = new SpecCaptcha(130, 48, 4);
|
||||
|
||||
// 获取验证码文本
|
||||
String code = captcha.text();
|
||||
|
||||
// 生成唯一的验证码 ID
|
||||
String captchaKey = IdUtil.randomUUID();
|
||||
|
||||
// 返回 Base64 格式验证码
|
||||
return Map.of("code", captcha.toBase64(), "uuid", captchaKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object login(SysLoginDTO loginDTO) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user