|
|
|
@@ -103,6 +103,10 @@ public class WxWeappInfoController extends BaseController { |
|
|
|
String appsStr = params.get("apps"); |
|
|
|
String typeStr = params.get("type"); |
|
|
|
|
|
|
|
if(StringUtils.isBlank(typeStr)) { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "type参数不能为空"); |
|
|
|
} |
|
|
|
|
|
|
|
Integer type = 0; |
|
|
|
try { |
|
|
|
type = Integer.parseInt(typeStr); |
|
|
|
@@ -116,26 +120,36 @@ public class WxWeappInfoController extends BaseController { |
|
|
|
WxWeappBasicSet weappBasicSet = weappBasicSetService.getByTypeAndDeploy(weappBasicSetQ); |
|
|
|
if(weappBasicSet == null) { |
|
|
|
logger.error("未找到相关的基础设置参数"); |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_CAST_ERROR); |
|
|
|
return new ResultData(ErrorCode.WEAPP_BASIC_SET_ERR); |
|
|
|
} |
|
|
|
|
|
|
|
JSONObject domainObj = JSON.parseObject(weappBasicSet.getDomainUrl()); |
|
|
|
if(domainObj == null) { |
|
|
|
logger.error("未找到相关的基础设置参数"); |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_CAST_ERROR); |
|
|
|
return new ResultData(ErrorCode.WEAPP_BASIC_SET_DOMAIN_ERR); |
|
|
|
} |
|
|
|
JSONObject templeObj = JSON.parseObject(weappBasicSet.getTemplateInfo()); |
|
|
|
|
|
|
|
if(StringUtils.isBlank(appsStr)) { |
|
|
|
WxWeappInfo weappInfoQ = new WxWeappInfo(); |
|
|
|
weappInfoQ.setType(type); |
|
|
|
List<WxWeappInfo> list = authorizerInfoService.getList(weappInfoQ); |
|
|
|
for(WxWeappInfo info: list) { |
|
|
|
appsStr += info.getAuthorizerAppid() + ","; |
|
|
|
} |
|
|
|
appsStr = appsStr.substring(0, appsStr.length() - 1); |
|
|
|
} |
|
|
|
|
|
|
|
// 逐一设置app配置 |
|
|
|
String [] apps = appsStr.split(","); |
|
|
|
for(String appId: apps) { |
|
|
|
// 检查appId是否已授权 |
|
|
|
WxAuthorizerInfo authorizerInfo = authorizerInfoService.getByAppId(appId); |
|
|
|
if(authorizerInfo == null) { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); |
|
|
|
return new ResultData(ErrorCode.WEAPP_APPID_NOT_AUTH); |
|
|
|
} |
|
|
|
if(!authorizerInfo.getAuthorizationStatus().equals(EnumWxAuthorizationStatus.AUTHORIZED.getCode())) { |
|
|
|
return new ResultData(ErrorCode.APP_NOT_AUTH); |
|
|
|
return new ResultData(ErrorCode.WEAPP_APPID_NOT_AUTH); |
|
|
|
} |
|
|
|
ResultData openRet = setBasicForAppId(appId, weappBasicSet, domainObj, templeObj); |
|
|
|
if (openRet != null) return openRet; |
|
|
|
@@ -149,7 +163,7 @@ public class WxWeappInfoController extends BaseController { |
|
|
|
// 设置基础版本 |
|
|
|
openMaService.setSupportVersion(weappBasicSet.getVersion()); |
|
|
|
// 服务器域名 |
|
|
|
String action = "set"; |
|
|
|
String action = "add"; |
|
|
|
JSONObject urlObj = domainObj.getJSONObject("url"); |
|
|
|
List<String> requestDomain = getUrlList(urlObj.getJSONArray("requestdomain")); |
|
|
|
List<String> wsrequestDomain = getUrlList(urlObj.getJSONArray("wsrequestdomain")); |
|
|
|
@@ -277,10 +291,10 @@ public class WxWeappInfoController extends BaseController { |
|
|
|
// 检查appId是否已授权 |
|
|
|
WxAuthorizerInfo authorizerInfo = authorizerInfoService.getByAppId(appId); |
|
|
|
if(authorizerInfo == null) { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); |
|
|
|
return new ResultData(ErrorCode.WEAPP_APPID_NOT_AUTH); |
|
|
|
} |
|
|
|
if(!authorizerInfo.getAuthorizationStatus().equals(EnumWxAuthorizationStatus.AUTHORIZED.getCode())) { |
|
|
|
return new ResultData(ErrorCode.APP_NOT_AUTH); |
|
|
|
return new ResultData(ErrorCode.WEAPP_APPID_NOT_AUTH); |
|
|
|
} |
|
|
|
codeOperation(appId, userVersion, userDesc, templateId); |
|
|
|
} |
|
|
|
|