feat: 优化3
This commit is contained in:
@@ -61,8 +61,8 @@ public class SmsServiceImpl implements SmsService {
|
||||
*/
|
||||
@Override
|
||||
public MsgPlatformResponse sendSms(MsgPlatformSmsRequest request) {
|
||||
if ("prd".equalsIgnoreCase(conf.get("nutz.profiles.active"))) {
|
||||
return zjnuMsgService.send(request, "SMS");
|
||||
if (Strings.isNotBlank(conf.get("custom.msg.platform.app-id"))) {
|
||||
return zjnuMsgService.send(request, conf.getBoolean("msg.platform.IntelligenceMode", false) ? "IntelligenceMode" : "SMS");
|
||||
}
|
||||
validateCommonRequest(request);
|
||||
JSONObject payload = buildCommonPayload(request, true);
|
||||
@@ -112,7 +112,7 @@ public class SmsServiceImpl implements SmsService {
|
||||
*/
|
||||
@Override
|
||||
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");
|
||||
}
|
||||
validateCommonRequest(request);
|
||||
@@ -350,7 +350,7 @@ public class SmsServiceImpl implements SmsService {
|
||||
* @param 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;
|
||||
}
|
||||
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")
|
||||
@ApiOperation("用户cas登录统一入口")
|
||||
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.pubsub.PubSubService;
|
||||
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.IocBean;
|
||||
import org.nutz.json.Json;
|
||||
@@ -62,6 +63,8 @@ public class SysMsgServiceImpl extends BaseServiceImpl<Sys_msg> implements SysMs
|
||||
private ManyAddOrRenewUtil manyAddOrRenewUtil;
|
||||
@Inject
|
||||
private SmsService smsService;
|
||||
@Inject
|
||||
private PropertiesProxy conf;
|
||||
|
||||
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(() -> {
|
||||
for (String loginName : loginNames) {
|
||||
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;
|
||||
|
||||
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);
|
||||
initRoute(sysRouteService);
|
||||
initTask(sysTaskService);
|
||||
|
||||
@@ -189,7 +189,7 @@ public class WkFailProcessor extends ViewProcessor {
|
||||
if (Globals.sso) {
|
||||
//1.判断是否为企业微信浏览器并且对接了企业微信
|
||||
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);
|
||||
} else if (browserPlatform == BrowserPlatform.QI_YE_WEI_XIN && propertiesProxy.getBoolean("wxwork.enable", false)) {
|
||||
//进行企业微信授权
|
||||
|
||||
@@ -67,6 +67,7 @@ custom:
|
||||
msg:
|
||||
platform:
|
||||
enabled: false
|
||||
IntelligenceMode: false
|
||||
base-url: https://msg.zjnu.cug.edu.cn
|
||||
tp-name: nwszl.cug.edu.cn
|
||||
default-send-user-id: 790036
|
||||
|
||||
@@ -68,6 +68,7 @@ custom:
|
||||
msg:
|
||||
platform:
|
||||
enabled: true
|
||||
IntelligenceMode: false
|
||||
app-id: 'MSG45363193'
|
||||
app-password: 'OGQxNzVmOTJkZjM5NzJhZDg1MDNiZGM0MDQ5ZTJlNDY'
|
||||
base-url: http://xxt.zjnu.edu.cn
|
||||
|
||||
@@ -190,6 +190,8 @@ data-center:
|
||||
msg:
|
||||
platform:
|
||||
enabled: '${custom.msg.platform.enabled}'
|
||||
# true 使用 v3 智能推送,false 使用 v4 短信及微信独立发送(浙师大消息平台)
|
||||
IntelligenceMode: '${custom.msg.platform.IntelligenceMode}'
|
||||
# 浙江师范大学通讯平台基础地址,默认对接正式地址
|
||||
base-url: '${custom.msg.platform.base-url}'
|
||||
# 授权系统名称,对应文档中的 tp_name
|
||||
|
||||
Reference in New Issue
Block a user