wuchao hace 4 meses
padre
commit
4744a87034

+ 5 - 5
renren-admin/pom.xml

@@ -170,11 +170,11 @@
 			<version>4.0.0</version>
 		</dependency>
 
-		<dependency>
-			<groupId>cn.hutool</groupId>
-			<artifactId>hutool-all</artifactId>
-			<version>4.1.1</version>
-		</dependency>
+<!--		<dependency>-->
+<!--			<groupId>cn.hutool</groupId>-->
+<!--			<artifactId>hutool-all</artifactId>-->
+<!--			<version>4.1.1</version>-->
+<!--		</dependency>-->
 
         <dependency>
             <groupId>org.bouncycastle</groupId>

+ 16 - 0
renren-admin/src/main/java/io/renren/common/config/YicProperties.java

@@ -0,0 +1,16 @@
+package io.renren.common.config;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+@Data
+@Component
+@ConfigurationProperties(prefix = "yic")
+public class YicProperties {
+
+    private String serverUrl;
+
+    private String loginUrl = "/api/miniapp/user/third/user/authorization/register";
+
+}

+ 6 - 0
renren-admin/src/main/java/io/renren/modules/job/utils/ScheduleUtils.java

@@ -51,6 +51,12 @@ public class ScheduleUtils {
      */
     public static void createScheduleJob(Scheduler scheduler, ScheduleJobEntity scheduleJob) {
         try {
+//            JobKey jobKey = getJobKey(scheduleJob.getJobId());
+//
+//            // 关键修复:先删除已存在的任务和触发器
+//            if (scheduler.checkExists(jobKey)) {
+//                scheduler.deleteJob(jobKey); // 删除任务及关联触发器
+//            }
         	//构建job信息
             JobDetail jobDetail = JobBuilder.newJob(ScheduleJob.class).withIdentity(getJobKey(scheduleJob.getJobId())).build();
 

+ 6 - 4
renren-admin/src/main/java/io/renren/modules/qyh/service/impl/ApiAuthServiceImpl.java

@@ -16,7 +16,9 @@ import javax.imageio.ImageIO;
 import javax.servlet.http.HttpServletResponse;
 
 import cn.binarywang.wx.miniapp.api.WxMaService;
+import cn.hutool.core.lang.Assert;
 import com.alibaba.fastjson.JSONObject;
+import io.renren.common.config.YicProperties;
 import io.renren.common.constant.WeChatConstant;
 import io.renren.modules.qmjz.entity.ScoreStu;
 import io.renren.modules.qmjz.entity.TaskManage;
@@ -86,8 +88,8 @@ public class ApiAuthServiceImpl implements ApiAuthService {
     @Autowired
     private TaskManageService taskManageService;
 
-    @Value("${yic.loginUrl}")
-    private String yicLoginUrl;
+    @Autowired
+    private YicProperties yicProperties;
 
     @Override
     public void sendCode(String mobile) {
@@ -335,11 +337,11 @@ public class ApiAuthServiceImpl implements ApiAuthService {
      * @return
      */
     private Map yicLogin(String mobile, String openId) {
-        Map<String, Object> paramMap = new HashMap<>(2);
+        Map<String, String> paramMap = new HashMap<>(2);
         paramMap.put("mobile", mobile);
         paramMap.put("openId", openId);
         try {
-            String resultStr = cn.hutool.http.HttpUtil.post(yicLoginUrl, paramMap);
+            String resultStr = cn.hutool.http.HttpUtil.post(yicProperties.getServerUrl() + yicProperties.getLoginUrl(), JSONObject.toJSONString(paramMap));
             if (ObjectUtil.isNotNull(resultStr)) {
                 JSONObject result = JSONObject.parseObject(resultStr);
                 if (ObjectUtil.isNotNull(result) && result.getInteger("code") == 200) {

+ 1 - 1
renren-admin/src/main/resources/application-dev.yml

@@ -68,4 +68,4 @@ spring:
         min-idle: 5       # 连接池中的最小空闲连接
 
 yic:
-  loginUrl: http://192.168.0.101:8203/third/user/authorization/register
+  serverUrl: http://192.168.0.101:8203