Browse Source

fix:安卓极光配置

liujunchi 3 years ago
parent
commit
b16396ce4a

+ 4 - 1
cooleshow-common/src/main/java/com/yonge/cooleshow/common/service/impl/RedisIdGeneratorService.java

@@ -32,6 +32,9 @@ public class RedisIdGeneratorService implements IdGeneratorService {
 	@Value("${message.debugMode}")
 	@Value("${message.debugMode}")
 	private boolean debugMode;
 	private boolean debugMode;
 
 
+	@Value("${message.authCode}")
+	private boolean authCode;
+
 	/**
 	/**
 	 * @Description
 	 * @Description
 	 * @author butterfly
 	 * @author butterfly
@@ -95,7 +98,7 @@ public class RedisIdGeneratorService implements IdGeneratorService {
 
 
 	@Override
 	@Override
 	public boolean verifyValidCode(String mobile, String authCode,String keyEnum) {
 	public boolean verifyValidCode(String mobile, String authCode,String keyEnum) {
-		if (debugMode) {
+		if (debugMode || this.authCode) {
 			if (defaultPwd.equals(authCode)) {
 			if (defaultPwd.equals(authCode)) {
 				return true;
 				return true;
 			}
 			}

+ 4 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/SysMessageServiceImpl.java

@@ -73,6 +73,9 @@ public class SysMessageServiceImpl extends BaseServiceImpl<Long, SysMessage> imp
 	@Value("${message.debugMode}")
 	@Value("${message.debugMode}")
 	private boolean debugMode;
 	private boolean debugMode;
 
 
+	@Value("${message.authCode}")
+	private boolean authCode;
+
 	@Override
 	@Override
 	public BaseDAO<Long, SysMessage> getDAO() {
 	public BaseDAO<Long, SysMessage> getDAO() {
 		return sysMessageDao;
 		return sysMessageDao;
@@ -346,7 +349,7 @@ public class SysMessageServiceImpl extends BaseServiceImpl<Long, SysMessage> imp
 
 
 		String key = getVerificationCodeCacheKey(messageType, receiver);
 		String key = getVerificationCodeCacheKey(messageType, receiver);
 		int code = DEFAULT_CODE;
 		int code = DEFAULT_CODE;
-		if (debugMode == false) {
+		if (debugMode == false && !authCode) {
 			code = getRandomCode(messageType, receiver);
 			code = getRandomCode(messageType, receiver);
 		}
 		}
 		Map<Long, String> receivers = new HashMap<>(1);
 		Map<Long, String> receivers = new HashMap<>(1);

+ 1 - 1
toolset/thirdparty-component/src/main/java/com/yonge/toolset/thirdparty/message/provider/AwSmsPlugin.java

@@ -35,7 +35,7 @@ public class AwSmsPlugin implements MessageSenderPlugin, InitializingBean {
 	 */
 	 */
 	private String pswd = "9#O!9hSJ";
 	private String pswd = "9#O!9hSJ";
 
 
-	private String signature = "【管乐迷】";
+	private String signature = "【酷乐秀】";
 
 
 	public static String getName() {
 	public static String getName() {
 		return "awsms";
 		return "awsms";

+ 14 - 2
toolset/thirdparty-component/src/main/java/com/yonge/toolset/thirdparty/message/provider/JiguangPushPlugin.java

@@ -59,7 +59,7 @@ public class JiguangPushPlugin implements MessageSenderPlugin, InitializingBean
 	 * @param content 消息内容
 	 * @param content 消息内容
 	 * @return json对象
 	 * @return json对象
 	 */
 	 */
-	private JSONObject generateJson(String[] alias, String alert, String content, String url,String sound,String channelId) {
+	private JSONObject generateJson(String[] alias, String alert, String content, String url,String sound,String channelId,String type) {
 		JSONObject json = new JSONObject();
 		JSONObject json = new JSONObject();
 		JSONArray platform = new JSONArray();// 平台
 		JSONArray platform = new JSONArray();// 平台
 		platform.add("android");
 		platform.add("android");
@@ -89,9 +89,21 @@ public class JiguangPushPlugin implements MessageSenderPlugin, InitializingBean
 		JSONObject android_extras = new JSONObject();// android额外参数
 		JSONObject android_extras = new JSONObject();// android额外参数
 		android_extras.put("type", "infomation");
 		android_extras.put("type", "infomation");
 		android_extras.put("url", url);
 		android_extras.put("url", url);
+		android_extras.put("third_url_encode",true);
 		android_extras.put("memo", url);
 		android_extras.put("memo", url);
 		android.put("extras", android_extras);
 		android.put("extras", android_extras);
 
 
+		JSONObject android_intent = new JSONObject();// android额外参数
+		if ("STUDENT".equals(type)) {
+			android_intent.put("url",
+							   "intent:#Intent;action=cn.jiguang.push.customAction;component=com.cooleshow.student/com.cooleshow.student.ui.main.MainActivity;end");
+		} else {
+			android_intent.put("url",
+							   "intent:#Intent;action=cn.jiguang.push.customAction;component=com.cooleshow.teacher/com.cooleshow.teacher.ui.main.MainActivity;end");
+		}
+		android.put("intent",android_intent);
+
+
 		JSONObject ios = new JSONObject();// ios通知内容
 		JSONObject ios = new JSONObject();// ios通知内容
 		ios.put("alert", alert);
 		ios.put("alert", alert);
 		ios.put("sound", sound);
 		ios.put("sound", sound);
@@ -141,7 +153,7 @@ public class JiguangPushPlugin implements MessageSenderPlugin, InitializingBean
 				break;
 				break;
 		}
 		}
 		String authorization = "Basic " + base64_auth_string;
 		String authorization = "Basic " + base64_auth_string;
-		return sendPostRequest(generateJson(alias, alert, content, url,sound,channelId).toString(), authorization);
+		return sendPostRequest(generateJson(alias, alert, content, url,sound,channelId,type).toString(), authorization);
 	}
 	}
 
 
 	/**
 	/**