feat: 优化3
This commit is contained in:
@@ -61,8 +61,8 @@ public class SmsServiceImpl implements SmsService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public MsgPlatformResponse sendSms(MsgPlatformSmsRequest request) {
|
public MsgPlatformResponse sendSms(MsgPlatformSmsRequest request) {
|
||||||
if ("prd".equalsIgnoreCase(conf.get("nutz.profiles.active"))) {
|
if (Strings.isNotBlank(conf.get("custom.msg.platform.app-id"))) {
|
||||||
return zjnuMsgService.send(request, "SMS");
|
return zjnuMsgService.send(request, conf.getBoolean("msg.platform.IntelligenceMode", false) ? "IntelligenceMode" : "SMS");
|
||||||
}
|
}
|
||||||
validateCommonRequest(request);
|
validateCommonRequest(request);
|
||||||
JSONObject payload = buildCommonPayload(request, true);
|
JSONObject payload = buildCommonPayload(request, true);
|
||||||
@@ -112,7 +112,7 @@ public class SmsServiceImpl implements SmsService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public MsgPlatformResponse sendWechat(MsgPlatformWechatRequest request) {
|
public MsgPlatformResponse sendWechat(MsgPlatformWechatRequest request) {
|
||||||
if ("prd".equalsIgnoreCase(conf.get("nutz.profiles.active"))) {
|
if (Strings.isNotBlank(conf.get("custom.msg.platform.app-id"))) {
|
||||||
return zjnuMsgService.send(request, "WeChat");
|
return zjnuMsgService.send(request, "WeChat");
|
||||||
}
|
}
|
||||||
validateCommonRequest(request);
|
validateCommonRequest(request);
|
||||||
@@ -350,7 +350,7 @@ public class SmsServiceImpl implements SmsService {
|
|||||||
* @param request 平台请求参数
|
* @param request 平台请求参数
|
||||||
*/
|
*/
|
||||||
private void fillDefaultSenderInfo(MsgPlatformBaseRequest request) {
|
private void fillDefaultSenderInfo(MsgPlatformBaseRequest request) {
|
||||||
if ("prd".equalsIgnoreCase(conf.get("nutz.profiles.active"))) {
|
if (Strings.isNotBlank(conf.get("custom.msg.platform.app-id"))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
request.setSendUserId(getRequiredConfig("msg.platform.default-send-user-id", "请先配置 msg.platform.default-send-user-id"));
|
request.setSendUserId(getRequiredConfig("msg.platform.default-send-user-id", "请先配置 msg.platform.default-send-user-id"));
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ public class SysLoginController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@At(value = "/platform/sso/login", top = true)
|
@At(value = {"/platform/sso/login", "/sso/login"}, top = true)
|
||||||
@Ok("re")
|
@Ok("re")
|
||||||
@ApiOperation("用户cas登录统一入口")
|
@ApiOperation("用户cas登录统一入口")
|
||||||
public String ssoLogin(HttpSession httpSession, HttpServletRequest request, HttpServletResponse response) {
|
public String ssoLogin(HttpSession httpSession, HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import org.nutz.integration.jedis.JedisAgent;
|
|||||||
import org.nutz.integration.jedis.RedisService;
|
import org.nutz.integration.jedis.RedisService;
|
||||||
import org.nutz.integration.jedis.pubsub.PubSubService;
|
import org.nutz.integration.jedis.pubsub.PubSubService;
|
||||||
import org.nutz.ioc.aop.Aop;
|
import org.nutz.ioc.aop.Aop;
|
||||||
|
import org.nutz.ioc.impl.PropertiesProxy;
|
||||||
import org.nutz.ioc.loader.annotation.Inject;
|
import org.nutz.ioc.loader.annotation.Inject;
|
||||||
import org.nutz.ioc.loader.annotation.IocBean;
|
import org.nutz.ioc.loader.annotation.IocBean;
|
||||||
import org.nutz.json.Json;
|
import org.nutz.json.Json;
|
||||||
@@ -62,6 +63,8 @@ public class SysMsgServiceImpl extends BaseServiceImpl<Sys_msg> implements SysMs
|
|||||||
private ManyAddOrRenewUtil manyAddOrRenewUtil;
|
private ManyAddOrRenewUtil manyAddOrRenewUtil;
|
||||||
@Inject
|
@Inject
|
||||||
private SmsService smsService;
|
private SmsService smsService;
|
||||||
|
@Inject
|
||||||
|
private PropertiesProxy conf;
|
||||||
|
|
||||||
private static NutMap typeMap = NutMap.NEW().addv("system", "系统消息").addv("user", "用户消息");
|
private static NutMap typeMap = NutMap.NEW().addv("system", "系统消息").addv("user", "用户消息");
|
||||||
|
|
||||||
@@ -106,7 +109,10 @@ public class SysMsgServiceImpl extends BaseServiceImpl<Sys_msg> implements SysMs
|
|||||||
ThreadUtil.execute(() -> {
|
ThreadUtil.execute(() -> {
|
||||||
for (String loginName : loginNames) {
|
for (String loginName : loginNames) {
|
||||||
smsService.sendSmsByAccount(loginName,sysMsg.getNote());
|
smsService.sendSmsByAccount(loginName,sysMsg.getNote());
|
||||||
smsService.sendWechatTextByAccountOrMobile(loginName,sysMsg.getNote());
|
if (!(Strings.isNotBlank(conf.get("custom.msg.platform.app-id"))
|
||||||
|
&& conf.getBoolean("msg.platform.IntelligenceMode", false))) {
|
||||||
|
smsService.sendWechatTextByAccountOrMobile(loginName,sysMsg.getNote());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -62,9 +62,7 @@ public class Globals {
|
|||||||
private static String productionAppDomain;
|
private static String productionAppDomain;
|
||||||
|
|
||||||
public void init() {
|
public void init() {
|
||||||
if ("prd".equalsIgnoreCase(conf.get("nutz.profiles.active"))) {
|
productionAppDomain = conf.get("custom.app-domain");
|
||||||
productionAppDomain = conf.get("custom.app-domain");
|
|
||||||
}
|
|
||||||
initSysConfig(sysConfigService);
|
initSysConfig(sysConfigService);
|
||||||
initRoute(sysRouteService);
|
initRoute(sysRouteService);
|
||||||
initTask(sysTaskService);
|
initTask(sysTaskService);
|
||||||
|
|||||||
@@ -189,7 +189,7 @@ public class WkFailProcessor extends ViewProcessor {
|
|||||||
if (Globals.sso) {
|
if (Globals.sso) {
|
||||||
//1.判断是否为企业微信浏览器并且对接了企业微信
|
//1.判断是否为企业微信浏览器并且对接了企业微信
|
||||||
if (browserPlatform == BrowserPlatform.QI_YE_WEI_XIN && propertiesProxy.getBoolean("wxwork.enable", false)
|
if (browserPlatform == BrowserPlatform.QI_YE_WEI_XIN && propertiesProxy.getBoolean("wxwork.enable", false)
|
||||||
&& "prd".equalsIgnoreCase(propertiesProxy.get("nutz.profiles.active"))) {
|
&& "/platform/qywechat/getCode".equals(propertiesProxy.get("wxwork.redirectUri"))) {
|
||||||
new ServerRedirectView("/platform/qywechat/oauth?redirect=" + redirect).render(request, response, null);
|
new ServerRedirectView("/platform/qywechat/oauth?redirect=" + redirect).render(request, response, null);
|
||||||
} else if (browserPlatform == BrowserPlatform.QI_YE_WEI_XIN && propertiesProxy.getBoolean("wxwork.enable", false)) {
|
} else if (browserPlatform == BrowserPlatform.QI_YE_WEI_XIN && propertiesProxy.getBoolean("wxwork.enable", false)) {
|
||||||
//进行企业微信授权
|
//进行企业微信授权
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ custom:
|
|||||||
msg:
|
msg:
|
||||||
platform:
|
platform:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
IntelligenceMode: false
|
||||||
base-url: https://msg.zjnu.cug.edu.cn
|
base-url: https://msg.zjnu.cug.edu.cn
|
||||||
tp-name: nwszl.cug.edu.cn
|
tp-name: nwszl.cug.edu.cn
|
||||||
default-send-user-id: 790036
|
default-send-user-id: 790036
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ custom:
|
|||||||
msg:
|
msg:
|
||||||
platform:
|
platform:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
IntelligenceMode: false
|
||||||
app-id: 'MSG45363193'
|
app-id: 'MSG45363193'
|
||||||
app-password: 'OGQxNzVmOTJkZjM5NzJhZDg1MDNiZGM0MDQ5ZTJlNDY'
|
app-password: 'OGQxNzVmOTJkZjM5NzJhZDg1MDNiZGM0MDQ5ZTJlNDY'
|
||||||
base-url: http://xxt.zjnu.edu.cn
|
base-url: http://xxt.zjnu.edu.cn
|
||||||
|
|||||||
@@ -190,6 +190,8 @@ data-center:
|
|||||||
msg:
|
msg:
|
||||||
platform:
|
platform:
|
||||||
enabled: '${custom.msg.platform.enabled}'
|
enabled: '${custom.msg.platform.enabled}'
|
||||||
|
# true 使用 v3 智能推送,false 使用 v4 短信及微信独立发送(浙师大消息平台)
|
||||||
|
IntelligenceMode: '${custom.msg.platform.IntelligenceMode}'
|
||||||
# 浙江师范大学通讯平台基础地址,默认对接正式地址
|
# 浙江师范大学通讯平台基础地址,默认对接正式地址
|
||||||
base-url: '${custom.msg.platform.base-url}'
|
base-url: '${custom.msg.platform.base-url}'
|
||||||
# 授权系统名称,对应文档中的 tp_name
|
# 授权系统名称,对应文档中的 tp_name
|
||||||
|
|||||||
Reference in New Issue
Block a user