feat(login): 添加微信登录中的应用运行状态检查功能

- 引入 CmsWebsite 和 CmsWebsiteService 依赖
- 注入 CmsWebsiteService 服务实例
- 实现基于租户ID的应用运行状态判断逻辑
- 根据运行状态动态设置页面检查路径和环境版本参数
- 当应用状态为试用模式时禁用路径检查并切换到试用环境
This commit is contained in:
2026-01-20 11:21:40 +08:00
parent e36524de3a
commit ceaaf287b0

View File

@@ -10,6 +10,8 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.gxwebsoft.cms.entity.CmsWebsite;
import com.gxwebsoft.cms.service.CmsWebsiteService;
import com.gxwebsoft.common.core.config.ConfigProperties;
import com.gxwebsoft.common.core.exception.BusinessException;
import com.gxwebsoft.common.core.security.JwtSubject;
@@ -74,6 +76,8 @@ public class WxLoginController extends BaseController {
private ConfigProperties config;
@Resource
private UserRefereeService userRefereeService;
@Resource
private CmsWebsiteService cmsWebsiteService;
public WxLoginController(StringRedisTemplate redisTemplate) {
@@ -442,6 +446,13 @@ public class WxLoginController extends BaseController {
map.put("page", "pages/index/index");
map.put("env_version", "release");
// 判断应用运行状态
final CmsWebsite website = cmsWebsiteService.getByTenantId(tenantId);
if(website.getRunning().equals(2)){
map.put("check_path",false);
map.put("env_version","trial");
}
String jsonBody = JSON.toJSONString(map);
System.out.println("请求的 JSON body = " + jsonBody);