This commit is contained in:
daihh
2022-11-03 23:38:13 +08:00
parent 550a3e45ff
commit 053edae6a2

View File

@@ -26,6 +26,7 @@ import com.xboe.constants.Constants;
import com.xboe.core.IAuthorizationToken;
import com.xboe.core.JsonResponse;
import com.xboe.core.api.ApiBaseController;
import com.xboe.core.event.IEventDataSender;
import com.xboe.system.logs.entity.SysLogLogin;
import com.xboe.system.logs.service.ISysLogLoginService;
import com.xboe.system.user.entity.SysManager;
@@ -61,6 +62,9 @@ public class SysLoginApi extends ApiBaseController {
@Autowired
StringRedisTemplate redisTemplate;
@Autowired(required = false)
private IEventDataSender eventSender;
@GetMapping("/captcha")
public JsonResponse<Map<String, String>> captcha() {
@@ -76,6 +80,24 @@ public class SysLoginApi extends ApiBaseController {
map.put("image", specCaptcha.toBase64());
return success(map);
}
@GetMapping("/login/send")
public JsonResponse<Map<String, String>> sendMessage() {
Map<String, String> rs=new HashMap<String, String>();
if(eventSender!=null) {
try {
eventSender.send("测试消息","keykey", "all测试消息","1231231", "1", "aaaa", "asdqadqw","wqwrqre","");
}catch(Exception e) {
e.printStackTrace();
return error("发送失败"+e.getMessage());
}
}else {
//log.error();
return error("未配置事件消息发送的实现");
}
return success(rs);
}
/**
* 根据用户名和密码登录