This commit is contained in:
Leo
2023-11-14 10:08:21 +08:00
parent ce4ef7162e
commit 0c80fb1fed
2 changed files with 9 additions and 8 deletions

View File

@@ -11,10 +11,7 @@ import cn.van333.wxsend.util.WxSendUtil;
import cn.van333.wxsend.util.request.MessageRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
/**
* @author Leo
@@ -50,13 +47,19 @@ public class WXController {
}
/**
* @description 会获取不到vanToken 和 touser
* @param message
* @return cn.van333.wxsend.business.model.R
* @throws
* */
@RequestMapping(value = "/send/ql")
@ResponseBody
@RateLimiter(time = 5, count = 60)
public R sendToQL(@RequestBody MessageRequest message) throws Exception {
public R sendToQL(@RequestParam("token") String vanToken,@RequestBody MessageRequest message) throws Exception {
logger.info(message.toString());
if (!TokenUtil.checkToken(message.getVanToken())) {
if (!TokenUtil.checkToken(vanToken)) {
return R.error("vanToken无效");
}
if (!StrUtil.isAllNotEmpty(message.getTitle(), message.getText())) {

View File

@@ -14,8 +14,6 @@
<!-- magenta:洋红 -->
<property name="CONSOLE_LOG_PATTERN"
value="%yellow(%date{yyyy-MM-dd HH:mm:ss}) |%highlight(%-5level) |%blue(%file:%line) |%cyan(%msg%n)"/>
<!-- 控制台输出 -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>