fix(config): 更新服务器 URL 和添加微信扫码页面地址配置

- 将多个配置环境中的服务器 URL 更新为 https://server.websoft.top/api
- 在公共配置中添加微信扫码 H5 页面访问地址 wechat-scan-url
- 修改二维码登录服务优先使用微信扫码专用地址,确保扫码登录跳转
- 更新请求工具类和租户服务中服务器相关 URL
- 修正微信公众号授权回调 URL 使用新的服务器地址
This commit is contained in:
2026-04-06 14:17:22 +08:00
parent 3131b20c5b
commit 7927559b70
9 changed files with 21 additions and 10 deletions

View File

@@ -99,9 +99,13 @@ public class QrLoginServiceImpl implements QrLoginService {
// 生成微信扫码登录 H5 页面 URL // 生成微信扫码登录 H5 页面 URL
try { try {
String appId = wxService.getOfficialAppId(tenantId); String appId = wxService.getOfficialAppId(tenantId);
String baseUrl = configProperties.getFileServer(); // 优先使用专门的微信扫码配置,否则使用文件服务器地址
String baseUrl = configProperties.getWechatScanUrl();
if (StrUtil.isBlank(baseUrl)) { if (StrUtil.isBlank(baseUrl)) {
baseUrl = "https://server.gxwebsoft.com"; baseUrl = configProperties.getFileServer();
}
if (StrUtil.isBlank(baseUrl)) {
baseUrl = "https://server.websoft.top";
} }
// 微信扫码后跳转的 H5 确认页面 // 微信扫码后跳转的 H5 确认页面
String wechatScanUrl = baseUrl + "/wx-scan?token=" + token; String wechatScanUrl = baseUrl + "/wx-scan?token=" + token;
@@ -388,12 +392,12 @@ public class QrLoginServiceImpl implements QrLoginService {
wrapper.eq(UserOauth::getOauthId, openId); wrapper.eq(UserOauth::getOauthId, openId);
} }
wrapper.eq(UserOauth::getDeleted, 0); wrapper.eq(UserOauth::getDeleted, 0);
UserOauth userOauth = null; UserOauth userOauth = null;
if (userOauthService != null) { if (userOauthService != null) {
userOauth = userOauthService.getOne(wrapper); userOauth = userOauthService.getOne(wrapper);
} }
if (userOauth != null && userOauth.getUserId() != null) { if (userOauth != null && userOauth.getUserId() != null) {
user = userService.getAllByUserId(String.valueOf(userOauth.getUserId())); user = userService.getAllByUserId(String.valueOf(userOauth.getUserId()));
log.info("通过 UserOauth 查找到用户: {}", user != null ? user.getUsername() : "未找到"); log.info("通过 UserOauth 查找到用户: {}", user != null ? user.getUsername() : "未找到");

View File

@@ -97,6 +97,11 @@ public class ConfigProperties {
*/ */
private String websopyUrl; private String websopyUrl;
/**
* 微信扫码H5页面访问地址用于微信扫码登录跳转
*/
private String wechatScanUrl;
/** /**
* 阿里云存储 OSS * 阿里云存储 OSS
* Endpoint * Endpoint

View File

@@ -11,7 +11,7 @@ import java.util.HashMap;
@Component @Component
public class RequestUtil { public class RequestUtil {
private static final String SERVER_HOST = "https://server.gxwebsoft.com/api"; private static final String SERVER_HOST = "https://server.websoft.top/api";
private static final String MODULES_HOST = "https://modules.gxwebsoft.com/api"; private static final String MODULES_HOST = "https://modules.gxwebsoft.com/api";
private static String ACCESS_TOKEN; private static String ACCESS_TOKEN;
private static String TENANT_ID; private static String TENANT_ID;

View File

@@ -72,7 +72,7 @@ public class WxOfficialUtil {
} }
public String getCodeUrl() throws UnsupportedEncodingException { public String getCodeUrl() throws UnsupportedEncodingException {
String encodedReturnUrl = URLEncoder.encode("https://server.gxwebsoft.com/api/open/wx-official/accessToken","UTF-8"); String encodedReturnUrl = URLEncoder.encode("https://server.websoft.top/api/open/wx-official/accessToken","UTF-8");
return "https://open.weixin.qq.com/connect/oauth2/authorize?appid="+ this.appId +"&redirect_uri=" + encodedReturnUrl + "&response_type=code&scope=snsapi_userinfo&state="+ this.tenantId +"#wechat_redirect"; return "https://open.weixin.qq.com/connect/oauth2/authorize?appid="+ this.appId +"&redirect_uri=" + encodedReturnUrl + "&response_type=code&scope=snsapi_userinfo&state="+ this.tenantId +"#wechat_redirect";
} }

View File

@@ -125,7 +125,7 @@ public class TenantServiceImpl extends ServiceImpl<TenantMapper, Tenant> impleme
company.setShortName(company.getShortName()); company.setShortName(company.getShortName());
company.setPhone(company.getPhone()); company.setPhone(company.getPhone());
company.setMembers(20); company.setMembers(20);
company.setServerUrl("https://server.gxwebsoft.com"); company.setServerUrl("https://server.websoft.top");
company.setModulesUrl("https://cms-api.websoft.top"); company.setModulesUrl("https://cms-api.websoft.top");
company.setSocketUrl("wss://server.gxwebsoft.com"); company.setSocketUrl("wss://server.gxwebsoft.com");
company.setAdminUrl(DomainUtil.getAdminUrl(company.getTid().toString())); company.setAdminUrl(DomainUtil.getAdminUrl(company.getTid().toString()));

View File

@@ -32,4 +32,4 @@ config:
upload-path: /Users/gxwebsoft/Documents/uploads upload-path: /Users/gxwebsoft/Documents/uploads
#swagger: #swagger:
#host: https://server.gxwebsoft.com/swagger-ui/index.html #host: https://server.websoft.top/swagger-ui/index.html

View File

@@ -35,7 +35,7 @@ knife4j:
# 框架配置 # 框架配置
config: config:
# 生产环境接口 # 生产环境接口
server-url: https://server.gxwebsoft.com/api server-url: https://server.websoft.top/api
upload-path: /www/wwwroot/file.ws upload-path: /www/wwwroot/file.ws
# 阿里云OSS云存储 # 阿里云OSS云存储

View File

@@ -35,7 +35,7 @@ knife4j:
# 框架配置 # 框架配置
config: config:
# 生产环境接口 # 生产环境接口
server-url: https://server.gxwebsoft.com/api server-url: https://server.websoft.top/api
upload-path: /www/wwwroot/file.ws upload-path: /www/wwwroot/file.ws
# 阿里云OSS云存储 # 阿里云OSS云存储

View File

@@ -95,6 +95,8 @@ config:
token-key: WLgNsWJ8rPjRtnjzX/Gx2RGS80Kwnm/ZeLbvIL+NrBs= token-key: WLgNsWJ8rPjRtnjzX/Gx2RGS80Kwnm/ZeLbvIL+NrBs=
server-url: https://server.websoft.top/api server-url: https://server.websoft.top/api
file-server: https://file.websoft.top file-server: https://file.websoft.top
# 微信扫码H5页面访问地址用于微信扫码登录跳转
wechat-scan-url: https://websopy.websoft.top
upload-path: /Users/gxwebsoft/Documents/uploads upload-path: /Users/gxwebsoft/Documents/uploads
local-upload-path: /Users/gxwebsoft/Documents/uploads local-upload-path: /Users/gxwebsoft/Documents/uploads