mirror of
https://gitcode.com/ageerle/ruoyi-ai.git
synced 2026-04-06 00:07:34 +00:00
增加后台管理,支持docker部署
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
package com.xmzs.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.xmzs.common.core.domain.R;
|
||||
import com.xmzs.common.wechat.Wechat;
|
||||
import com.xmzs.common.wechat.controller.LoginController;
|
||||
import com.xmzs.common.wechat.core.MsgCenter;
|
||||
import com.xmzs.system.cofing.KeywordConfig;
|
||||
import com.xmzs.system.cofing.QqConfig;
|
||||
import com.xmzs.system.cofing.WechatConfig;
|
||||
import com.xmzs.system.handler.WechatMessageHandler;
|
||||
import com.xmzs.system.service.ISseService;
|
||||
@@ -11,7 +13,7 @@ import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
@@ -39,13 +41,21 @@ public class WeChatController {
|
||||
* 获取微信登录二维码
|
||||
*
|
||||
*/
|
||||
@PostMapping("/getQr")
|
||||
public void getQr() {
|
||||
@GetMapping("/getQr")
|
||||
public R<String> getQr() {
|
||||
//微信
|
||||
if (wechatConfig.getEnable()){
|
||||
log.info("正在登录微信,请按提示操作:");
|
||||
wechatBot = new Wechat(new WechatMessageHandler(sseService, keywordConfig), wechatConfig.getQrPath());
|
||||
wechatBot = new Wechat(new WechatMessageHandler(sseService, keywordConfig));
|
||||
// 登陆
|
||||
LoginController login = new LoginController();
|
||||
String qrCode = login.login_1();
|
||||
new Thread(login::login_2).start();
|
||||
wechatBot.start();
|
||||
return R.ok(qrCode);
|
||||
}else {
|
||||
return R.fail();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user