diff --git a/src/main/java/com/gxwebsoft/auto/service/impl/QrLoginServiceImpl.java b/src/main/java/com/gxwebsoft/auto/service/impl/QrLoginServiceImpl.java index 8d068c2..98755a9 100644 --- a/src/main/java/com/gxwebsoft/auto/service/impl/QrLoginServiceImpl.java +++ b/src/main/java/com/gxwebsoft/auto/service/impl/QrLoginServiceImpl.java @@ -99,9 +99,13 @@ public class QrLoginServiceImpl implements QrLoginService { // 生成微信扫码登录 H5 页面 URL try { String appId = wxService.getOfficialAppId(tenantId); - String baseUrl = configProperties.getFileServer(); + // 优先使用专门的微信扫码配置,否则使用文件服务器地址 + String baseUrl = configProperties.getWechatScanUrl(); if (StrUtil.isBlank(baseUrl)) { - baseUrl = "https://server.gxwebsoft.com"; + baseUrl = configProperties.getFileServer(); + } + if (StrUtil.isBlank(baseUrl)) { + baseUrl = "https://server.websoft.top"; } // 微信扫码后跳转的 H5 确认页面 String wechatScanUrl = baseUrl + "/wx-scan?token=" + token; @@ -388,12 +392,12 @@ public class QrLoginServiceImpl implements QrLoginService { wrapper.eq(UserOauth::getOauthId, openId); } wrapper.eq(UserOauth::getDeleted, 0); - + UserOauth userOauth = null; if (userOauthService != null) { userOauth = userOauthService.getOne(wrapper); } - + if (userOauth != null && userOauth.getUserId() != null) { user = userService.getAllByUserId(String.valueOf(userOauth.getUserId())); log.info("通过 UserOauth 查找到用户: {}", user != null ? user.getUsername() : "未找到"); diff --git a/src/main/java/com/gxwebsoft/common/core/config/ConfigProperties.java b/src/main/java/com/gxwebsoft/common/core/config/ConfigProperties.java index 9d65d24..c8afd9c 100644 --- a/src/main/java/com/gxwebsoft/common/core/config/ConfigProperties.java +++ b/src/main/java/com/gxwebsoft/common/core/config/ConfigProperties.java @@ -97,6 +97,11 @@ public class ConfigProperties { */ private String websopyUrl; + /** + * 微信扫码H5页面访问地址(用于微信扫码登录跳转) + */ + private String wechatScanUrl; + /** * 阿里云存储 OSS * Endpoint diff --git a/src/main/java/com/gxwebsoft/common/core/utils/RequestUtil.java b/src/main/java/com/gxwebsoft/common/core/utils/RequestUtil.java index 1787122..e8cbc30 100644 --- a/src/main/java/com/gxwebsoft/common/core/utils/RequestUtil.java +++ b/src/main/java/com/gxwebsoft/common/core/utils/RequestUtil.java @@ -11,7 +11,7 @@ import java.util.HashMap; @Component 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 String ACCESS_TOKEN; private static String TENANT_ID; diff --git a/src/main/java/com/gxwebsoft/common/core/utils/WxOfficialUtil.java b/src/main/java/com/gxwebsoft/common/core/utils/WxOfficialUtil.java index 077e615..0851846 100644 --- a/src/main/java/com/gxwebsoft/common/core/utils/WxOfficialUtil.java +++ b/src/main/java/com/gxwebsoft/common/core/utils/WxOfficialUtil.java @@ -72,7 +72,7 @@ public class WxOfficialUtil { } 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"; } diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/TenantServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/TenantServiceImpl.java index c198652..ba23291 100644 --- a/src/main/java/com/gxwebsoft/common/system/service/impl/TenantServiceImpl.java +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/TenantServiceImpl.java @@ -125,7 +125,7 @@ public class TenantServiceImpl extends ServiceImpl impleme company.setShortName(company.getShortName()); company.setPhone(company.getPhone()); company.setMembers(20); - company.setServerUrl("https://server.gxwebsoft.com"); + company.setServerUrl("https://server.websoft.top"); company.setModulesUrl("https://cms-api.websoft.top"); company.setSocketUrl("wss://server.gxwebsoft.com"); company.setAdminUrl(DomainUtil.getAdminUrl(company.getTid().toString())); diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index bb600fe..d30dd5c 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -32,4 +32,4 @@ config: upload-path: /Users/gxwebsoft/Documents/uploads #swagger: -#host: https://server.gxwebsoft.com/swagger-ui/index.html +#host: https://server.websoft.top/swagger-ui/index.html diff --git a/src/main/resources/application-hjm.yml b/src/main/resources/application-hjm.yml index f472de7..badfd5c 100644 --- a/src/main/resources/application-hjm.yml +++ b/src/main/resources/application-hjm.yml @@ -35,7 +35,7 @@ knife4j: # 框架配置 config: # 生产环境接口 - server-url: https://server.gxwebsoft.com/api + server-url: https://server.websoft.top/api upload-path: /www/wwwroot/file.ws # 阿里云OSS云存储 diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index dc5cb9f..374b2bc 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -35,7 +35,7 @@ knife4j: # 框架配置 config: # 生产环境接口 - server-url: https://server.gxwebsoft.com/api + server-url: https://server.websoft.top/api upload-path: /www/wwwroot/file.ws # 阿里云OSS云存储 diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 3693350..b2a34a9 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -95,6 +95,8 @@ config: token-key: WLgNsWJ8rPjRtnjzX/Gx2RGS80Kwnm/ZeLbvIL+NrBs= server-url: https://server.websoft.top/api file-server: https://file.websoft.top + # 微信扫码H5页面访问地址(用于微信扫码登录跳转) + wechat-scan-url: https://websopy.websoft.top upload-path: /Users/gxwebsoft/Documents/uploads local-upload-path: /Users/gxwebsoft/Documents/uploads