perf:优化ip2region,改为从服务器下载db文件,而不是打包到项目中

This commit is contained in:
yz
2023-01-09 22:50:47 +08:00
parent 53e35ccb52
commit dd87b00612
14 changed files with 101 additions and 47 deletions

View File

@@ -15,6 +15,7 @@ import com.tiesheng.platform.config.ding.bean.DingUserInfo;
import com.tiesheng.platform.config.wxmp.PlatformWxmpConfig;
import com.tiesheng.platform.config.wxmp.bean.WxJsapiSignature;
import com.tiesheng.platform.config.wxmp.bean.WxUserInfo;
import com.tiesheng.util.config.GlobalConfig;
import com.tiesheng.util.exception.ApiException;
import com.tiesheng.util.pojos.ApiResp;
import org.springframework.beans.factory.annotation.Autowired;
@@ -42,6 +43,8 @@ public class LoginController {
LoginService loginService;
@Autowired
TsTokenConfig tsTokenConfig;
@Autowired
GlobalConfig globalConfig;
/**
@@ -105,7 +108,7 @@ public class LoginController {
map.put("extra", extra);
loginService.checkLoginConfigurer(s -> {
String query = URLUtil.buildQuery(map, Charset.defaultCharset());
String configUrl = loginService.buildPath("/ding/index.html?" + query);
String configUrl = globalConfig.buildPath("/ding/index.html?" + query);
try {
response.sendRedirect(configUrl);
} catch (IOException ignored) {
@@ -162,7 +165,7 @@ public class LoginController {
if (StrUtil.isEmpty(extra)) {
extra = "";
}
String configUrl = loginService.buildPath("/auth/wxmp/oauth2/" + service + "?extra=" + extra);
String configUrl = globalConfig.buildPath("/auth/wxmp/oauth2/" + service + "?extra=" + extra);
String authorizationUrl = platformWxmpConfig.buildAuthorizationUrl(service, configUrl, "snsapi_userinfo");
response.sendRedirect(authorizationUrl);
}