|
|
|
@ -38,17 +38,19 @@ public class ConfigServiceImpl extends Service implements ConfigService {
|
|
|
|
|
String enable = bb.getPropValue("qtx_sso_login", "enable");
|
|
|
|
|
String userAgent = qtx.getUserAgent();
|
|
|
|
|
boolean termianal = MobileTerminalEnum.containsEnumValue(userAgent);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (Boolean.parseBoolean(enable)) {
|
|
|
|
|
QTXConfigPO qtxConfig = getConfigMapper().selectConfigInfo();
|
|
|
|
|
String domain = "0".equals(qtx.getDomainIndex()) ? qtxConfig.getUrl() : qtxConfig.getSecondUrl();
|
|
|
|
|
String address = termianal ? qtxConfig.getMobileAddress() : qtxConfig.getPcAddress();
|
|
|
|
|
String accessKey = URLEncoder.encode(getAccessKey(qtxConfig.getAppSecret()),"utf-8");
|
|
|
|
|
hkUrl = StrUtil.format("{}/{}?accessKey={}&type={}&username={}&whole={}",domain,address,accessKey,qtx.getType(),qtx.getLoginId(),qtx.getWhole());
|
|
|
|
|
hkUrl = StrUtil.format("{}{}?accessKey={}&type={}&username={}&whole={}&domainIndex={}",domain,address,accessKey,qtx.getType(),qtx.getLoginId(),qtx.getWhole(),qtx.getDomainIndex());
|
|
|
|
|
}else {
|
|
|
|
|
String accessKey = URLEncoder.encode(getAccessKey(bb.getPropValue("qtx_sso_login", "app_secret")),"utf-8");
|
|
|
|
|
String domain = "0".equals(qtx.getDomainIndex()) ? bb.getPropValue("qtx_sso_login","url") : bb.getPropValue("qtx_sso_login","url1");
|
|
|
|
|
String address = termianal ? bb.getPropValue("qtx_sso_login","h5address") : bb.getPropValue("qtx_sso_login","pcaddress");
|
|
|
|
|
hkUrl = StrUtil.format("{}/{}?accessKey={}&type={}&username={}&whole={}",domain,address,accessKey,qtx.getType(),qtx.getLoginId(),qtx.getWhole());
|
|
|
|
|
hkUrl = StrUtil.format("{}{}?accessKey={}&type={}&username={}&whole={}&domainIndex={}",domain,address,accessKey,qtx.getType(),qtx.getLoginId(),qtx.getWhole(),qtx.getDomainIndex());
|
|
|
|
|
}
|
|
|
|
|
return hkUrl;
|
|
|
|
|
}
|
|
|
|
|