Просмотр исходного кода

腾讯云sdk接入,短信接口引入人机验证

ZhangWenQiang 5 лет назад
Родитель
Сommit
e43e0cc72f

+ 91 - 58
happy-boot-base-common/src/main/java/org/jeecg/common/util/IPUtils.java

@@ -1,58 +1,91 @@
-package org.jeecg.common.util;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.commons.lang.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * IP地址
- * 
- * @Author scott
- * @email jeecgos@163.com
- * @Date 2019年01月14日
- */
-public class IPUtils {
-	private static Logger logger = LoggerFactory.getLogger(IPUtils.class);
-
-	/**
-	 * 获取IP地址
-	 * 
-	 * 使用Nginx等反向代理软件, 则不能通过request.getRemoteAddr()获取IP地址
-	 * 如果使用了多级反向代理的话,X-Forwarded-For的值并不止一个,而是一串IP地址,X-Forwarded-For中第一个非unknown的有效IP字符串,则为真实IP地址
-	 */
-	public static String getIpAddr(HttpServletRequest request) {
-    	String ip = null;
-        try {
-            ip = request.getHeader("x-forwarded-for");
-            if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) {
-                ip = request.getHeader("Proxy-Client-IP");
-            }
-            if (StringUtils.isEmpty(ip) || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
-                ip = request.getHeader("WL-Proxy-Client-IP");
-            }
-            if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) {
-                ip = request.getHeader("HTTP_CLIENT_IP");
-            }
-            if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) {
-                ip = request.getHeader("HTTP_X_FORWARDED_FOR");
-            }
-            if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) {
-                ip = request.getRemoteAddr();
-            }
-        } catch (Exception e) {
-        	logger.error("IPUtils ERROR ", e);
-        }
-        
-//        //使用代理,则获取第一个IP地址
-//        if(StringUtils.isEmpty(ip) && ip.length() > 15) {
-//			if(ip.indexOf(",") > 0) {
-//				ip = ip.substring(0, ip.indexOf(","));
-//			}
-//		}
-        
-        return ip;
-    }
-	
-}
+package org.jeecg.common.util;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.commons.lang.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * IP地址
+ * 
+ * @Author scott
+ * @email jeecgos@163.com
+ * @Date 2019年01月14日
+ */
+public class IPUtils {
+	private static Logger logger = LoggerFactory.getLogger(IPUtils.class);
+    private static final String UNKNOW = "unknown";
+	/**
+	 * 获取IP地址
+	 * 
+	 * 使用Nginx等反向代理软件, 则不能通过request.getRemoteAddr()获取IP地址
+	 * 如果使用了多级反向代理的话,X-Forwarded-For的值并不止一个,而是一串IP地址,X-Forwarded-For中第一个非unknown的有效IP字符串,则为真实IP地址
+	 */
+	public static String getIpAddr(HttpServletRequest request) {
+    	String ip = null;
+        try {
+            ip = request.getHeader("x-forwarded-for");
+            if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) {
+                ip = request.getHeader("Proxy-Client-IP");
+            }
+            if (StringUtils.isEmpty(ip) || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+                ip = request.getHeader("WL-Proxy-Client-IP");
+            }
+            if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) {
+                ip = request.getHeader("HTTP_CLIENT_IP");
+            }
+            if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) {
+                ip = request.getHeader("HTTP_X_FORWARDED_FOR");
+            }
+            if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) {
+                ip = request.getRemoteAddr();
+            }
+        } catch (Exception e) {
+        	logger.error("IPUtils ERROR ", e);
+        }
+        
+//        //使用代理,则获取第一个IP地址
+//        if(StringUtils.isEmpty(ip) && ip.length() > 15) {
+//			if(ip.indexOf(",") > 0) {
+//				ip = ip.substring(0, ip.indexOf(","));
+//			}
+//		}
+        
+        return ip;
+    }
+
+    /**
+     * 获取请求IP
+     * 如果使用了多级反向代理的话,X-Forwarded-For的值并不止一个,而是一串IP地址,X-Forwarded-For中第一个非unknown的有效IP字符串,则为真实IP地址
+     *
+     * @return String IP
+     */
+    public static String getHttpServletRequestIpAddress(HttpServletRequest request) {
+        String ip = request.getHeader("x-forwarded-for");
+        /**
+         * 使用多级反向代理,则获取第一个IP地址
+         */
+        if (ip != null && ip.length() != 0 && !UNKNOW.equalsIgnoreCase(ip)) {
+            if (ip.contains(",")) {
+                ip = ip.split(",")[0];
+            }
+        }
+        if (ip == null || ip.length() == 0 || UNKNOW.equalsIgnoreCase(ip)) {
+            ip = request.getHeader("Proxy-Client-IP");
+        }
+        if (ip == null || ip.length() == 0 || UNKNOW.equalsIgnoreCase(ip)) {
+            ip = request.getHeader("WL-Proxy-Client-IP");
+        }
+        if (StringUtils.isEmpty(ip) || UNKNOW.equalsIgnoreCase(ip)) {
+            ip = request.getHeader("HTTP_CLIENT_IP");
+        }
+        if (StringUtils.isEmpty(ip) || UNKNOW.equalsIgnoreCase(ip)) {
+            ip = request.getHeader("HTTP_X_FORWARDED_FOR");
+        }
+        if (ip == null || ip.length() == 0 || UNKNOW.equalsIgnoreCase(ip)) {
+            ip = request.getRemoteAddr();
+        }
+        return "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : ip;
+    }
+}

+ 74 - 66
happy-boot-module-flexjob/pom.xml

@@ -1,67 +1,75 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>happy-boot-module-flexjob</artifactId>
-    <version>2.1.0</version>
-    <name>happywork</name>
-
-    <parent>
-        <artifactId>happy-boot-parent</artifactId>
-        <groupId>org.jeecgframework.boot</groupId>
-        <version>2.1.0</version>
-    </parent>
-
-    <repositories>
-        <repository>
-            <id>aliyun</id>
-            <name>aliyun Repository</name>
-            <url>http://maven.aliyun.com/nexus/content/groups/public</url>
-            <snapshots>
-                <enabled>false</enabled>
-            </snapshots>
-        </repository>
-        <repository>
-            <id>jeecg</id>
-            <name>jeecg Repository</name>
-            <url>http://maven.jeecg.org/nexus/content/repositories/jeecg</url>
-            <snapshots>
-                <enabled>false</enabled>
-            </snapshots>
-        </repository>
-    </repositories>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.jeecgframework.boot</groupId>
-            <artifactId>happy-boot-module-system</artifactId>
-            <version>2.1.0</version>
-        </dependency>
-        <dependency>
-            <groupId>org.jeecgframework.boot</groupId>
-            <artifactId>happy-boot-module-common</artifactId>
-            <version>2.1.0</version>
-        </dependency>
-        <dependency>
-            <groupId>org.jeecgframework.boot</groupId>
-            <artifactId>happy-boot-module-pay</artifactId>
-            <version>2.1.0</version>
-        </dependency>
-        <dependency>
-            <groupId>org.jeecgframework.boot</groupId>
-            <artifactId>happy-boot-module-econtract</artifactId>
-            <version>2.1.0</version>
-        </dependency>
-    </dependencies>
-
-    <build>
-        <finalName>happywork</finalName>
-        <plugins>
-            <plugin>
-                <groupId>org.springframework.boot</groupId>
-                <artifactId>spring-boot-maven-plugin</artifactId>
-            </plugin>
-        </plugins>
-    </build>
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>happy-boot-module-flexjob</artifactId>
+    <version>2.1.0</version>
+    <name>happywork</name>
+
+    <parent>
+        <artifactId>happy-boot-parent</artifactId>
+        <groupId>org.jeecgframework.boot</groupId>
+        <version>2.1.0</version>
+    </parent>
+
+    <repositories>
+        <repository>
+            <id>aliyun</id>
+            <name>aliyun Repository</name>
+            <url>http://maven.aliyun.com/nexus/content/groups/public</url>
+            <snapshots>
+                <enabled>false</enabled>
+            </snapshots>
+        </repository>
+        <repository>
+            <id>jeecg</id>
+            <name>jeecg Repository</name>
+            <url>http://maven.jeecg.org/nexus/content/repositories/jeecg</url>
+            <snapshots>
+                <enabled>false</enabled>
+            </snapshots>
+        </repository>
+    </repositories>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.jeecgframework.boot</groupId>
+            <artifactId>happy-boot-module-system</artifactId>
+            <version>2.1.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.jeecgframework.boot</groupId>
+            <artifactId>happy-boot-module-common</artifactId>
+            <version>2.1.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.jeecgframework.boot</groupId>
+            <artifactId>happy-boot-module-pay</artifactId>
+            <version>2.1.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.jeecgframework.boot</groupId>
+            <artifactId>happy-boot-module-econtract</artifactId>
+            <version>2.1.0</version>
+        </dependency>
+
+        <!--腾讯云sdk-->
+        <dependency>
+            <groupId>com.tencentcloudapi</groupId>
+            <artifactId>tencentcloud-sdk-java</artifactId>
+            <!-- 请到https://search.maven.org/search?q=tencentcloud-sdk-java查询最新版本 -->
+            <version>3.1.89</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <finalName>happywork</finalName>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </build>
 </project>

+ 108 - 108
happy-boot-module-flexjob/src/main/java/org/jeecg/modules/api/sys/LoginAppControllerAPI.java

@@ -1,108 +1,108 @@
-package org.jeecg.modules.api.sys;
-
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiImplicitParams;
-import io.swagger.annotations.ApiOperation;
-import lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.sms.SMSConst;
-import org.jeecg.common.util.ErrorCode;
-import org.jeecg.common.util.RedisUtil;
-import org.jeecg.common.util.StringUtils;
-import org.jeecg.modules.hwuser.service.IHwUserService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import org.springframework.web.servlet.ModelAndView;
-import org.springframework.web.servlet.view.json.MappingJackson2JsonView;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.util.HashMap;
-import java.util.Map;
-
-@Slf4j
-@Api(tags = "用户api")
-@RestController
-@RequestMapping("/api/hwuser")
-public class LoginAppControllerAPI extends BaseAppController {
-    @Autowired
-    private IHwUserService hwUserService;
-    @Autowired
-    private RedisUtil redisUtil;
-
-    /**
-     * 手机端快速登录,验证码发送
-     */
-    @ApiOperation(notes = "getAuthCode", httpMethod = "GET", value = "app获取验证码")
-    @ApiImplicitParams(@ApiImplicitParam(name = "phone", value = "手机号", required = true, paramType = "query", dataType = "string"))
-    @GetMapping(value = "/getAuthCode")
-    public ModelAndView getAuthCode4LoginQuickly(HttpServletRequest request, HttpServletResponse response) {
-        response.setHeader("Access-Control-Allow-Origin", "*");
-        response.setHeader("Access-Control-Allow-Method", "POST,GET");
-        Map<String, Object> obj = null;
-        HashMap<String, String> requestMap = findRequestMap(request);
-        Map<String, Object> map = new HashMap<>();
-        try {
-            Map<String, Object> returnMap = hwUserService.sendMobileCode(requestMap);
-            if (SMSConst.OKCode.equals(returnMap.get("success"))) {
-                map.put("code", returnMap.get("code"));
-                obj = successResult(ErrorCode.code_1000, "", map);
-            } else {
-                obj = errorResult(ErrorCode.code_1008, (String) returnMap.get("msg"));
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-            obj = errorResult(ErrorCode.code_1008, "获取验证码失败");
-            logError(request, e.getMessage(), e);
-        }
-
-        ModelAndView view = new ModelAndView(new MappingJackson2JsonView(), obj);
-        return view;
-    }
-
-    /**
-     * 手机端快速登录,登录验证
-     */
-    @PostMapping(value = "/phoneLogin")
-    public ModelAndView phoneLogin(HttpServletRequest request, HttpServletResponse response) {
-        response.setHeader("Access-Control-Allow-Origin", "*");
-        response.setHeader("Access-Control-Allow-Method", "POST,GET");
-        Map<String, Object> obj = null;
-        HashMap<String, String> requestMap = findRequestMap(request);
-        Map<String, Object> returnMap = new HashMap<String, Object>();
-        try {
-            String phone = requestMap.get("phone");
-            if (StringUtils.isNotBlank(phone)) {
-                if ("15214381724".equals(phone)) {
-                    returnMap = hwUserService.getLoginApp(requestMap, request);
-                    obj = successResult(ErrorCode.code_1000, "登录成功", returnMap);
-                }else{
-                    String code = (String) redisUtil.get(phone);
-                    String getCode = requestMap.get("code");
-                    if (StringUtils.isNotBlank(code) && StringUtils.isNotBlank(getCode)) {
-                        if (code.equals(getCode)) {
-                            returnMap = hwUserService.getLoginApp(requestMap, request);
-                            obj = successResult(ErrorCode.code_1000, "登录成功", returnMap);
-                        } else {
-                            obj = errorResult(ErrorCode.code_1011, "验证码错误");
-                        }
-                    } else {
-                        obj = errorResult(ErrorCode.code_1012, "验证码无效或用户不存在");
-                    }
-                }
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-            obj = errorResult(ErrorCode.code_1003, "登录失败");
-            logError(request, e.getMessage(), e);
-        }
-        ModelAndView view = new ModelAndView(new MappingJackson2JsonView(), obj);
-        return view;
-    }
-
-
-
-}
+package org.jeecg.modules.api.sys;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.sms.SMSConst;
+import org.jeecg.common.util.ErrorCode;
+import org.jeecg.common.util.RedisUtil;
+import org.jeecg.common.util.StringUtils;
+import org.jeecg.modules.hwuser.service.IHwUserService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.servlet.ModelAndView;
+import org.springframework.web.servlet.view.json.MappingJackson2JsonView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.HashMap;
+import java.util.Map;
+
+@Slf4j
+@Api(tags = "用户api")
+@RestController
+@RequestMapping("/api/hwuser")
+public class LoginAppControllerAPI extends BaseAppController {
+    @Autowired
+    private IHwUserService hwUserService;
+    @Autowired
+    private RedisUtil redisUtil;
+
+    /**
+     * 手机端快速登录,验证码发送
+     *
+     * @param request
+     * @param response
+     * @return
+     */
+    @ApiOperation(notes = "getCaptchaCode", httpMethod = "POST", value = "app获取验证码")
+    @ApiImplicitParams(@ApiImplicitParam(name = "phone", value = "手机号", required = true, paramType = "query", dataType = "string"))
+    @GetMapping(value = "/getCaptchaCode")
+    public ModelAndView getCaptchaCode(HttpServletRequest request, HttpServletResponse response) {
+        response.setHeader("Access-Control-Allow-Origin", "*");
+        response.setHeader("Access-Control-Allow-Method", "POST,GET");
+        Map<String, Object> obj = null;
+        HashMap<String, String> requestMap = findRequestMap(request);
+        Map<String, Object> map = new HashMap<>();
+        try {
+            Map<String, Object> returnMap = hwUserService.sendMobileCode(requestMap, request);
+            if (SMSConst.OKCode.equals(returnMap.get("success"))) {
+                map.put("code", returnMap.get("code"));
+                obj = successResult(ErrorCode.code_1000, "", map);
+            } else {
+                obj = errorResult(ErrorCode.code_1008, (String) returnMap.get("msg"));
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            obj = errorResult(ErrorCode.code_1008, "获取验证码失败");
+            logError(request, e.getMessage(), e);
+        }
+
+        ModelAndView view = new ModelAndView(new MappingJackson2JsonView(), obj);
+        return view;
+    }
+
+    /**
+     * 手机端快速登录,登录验证
+     */
+    @PostMapping(value = "/phoneLogin")
+    public ModelAndView phoneLogin(HttpServletRequest request, HttpServletResponse response) {
+        response.setHeader("Access-Control-Allow-Origin", "*");
+        response.setHeader("Access-Control-Allow-Method", "POST,GET");
+        Map<String, Object> obj = null;
+        HashMap<String, String> requestMap = findRequestMap(request);
+        Map<String, Object> returnMap = new HashMap<String, Object>();
+        try {
+            String phone = requestMap.get("phone");
+            if (StringUtils.isNotBlank(phone)) {
+                if ("15214381724".equals(phone)) {
+                    returnMap = hwUserService.getLoginApp(requestMap, request);
+                    obj = successResult(ErrorCode.code_1000, "登录成功", returnMap);
+                } else {
+                    String code = (String) redisUtil.get(phone);
+                    String getCode = requestMap.get("code");
+                    if (StringUtils.isNotBlank(code) && StringUtils.isNotBlank(getCode)) {
+                        if (code.equals(getCode)) {
+                            returnMap = hwUserService.getLoginApp(requestMap, request);
+                            obj = successResult(ErrorCode.code_1000, "登录成功", returnMap);
+                        } else {
+                            obj = errorResult(ErrorCode.code_1011, "验证码错误");
+                        }
+                    } else {
+                        obj = errorResult(ErrorCode.code_1012, "验证码无效或用户不存在");
+                    }
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            obj = errorResult(ErrorCode.code_1003, "登录失败");
+            logError(request, e.getMessage(), e);
+        }
+        ModelAndView view = new ModelAndView(new MappingJackson2JsonView(), obj);
+        return view;
+    }
+
+
+}

+ 44 - 0
happy-boot-module-flexjob/src/main/java/org/jeecg/modules/config/CaptchaConfig.java

@@ -0,0 +1,44 @@
+package org.jeecg.modules.config;
+
+import com.tencentcloudapi.captcha.v20190722.CaptchaClient;
+import com.tencentcloudapi.common.Credential;
+import com.tencentcloudapi.common.profile.ClientProfile;
+import com.tencentcloudapi.common.profile.HttpProfile;
+import org.jeecg.modules.util.Constants;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * @Author: zwq
+ * @Date: Create in 2020/7/10 9:32
+ * @Description: 腾讯云验证配置
+ */
+@Configuration
+public class CaptchaConfig {
+    @Value("${jeecg.tencent.secretId}")
+    private String secretId;
+    @Value("${jeecg.tencent.secretKey}")
+    private String secretKey;
+
+    /**
+     * 将CaptchaClient对象装配到Spring容器
+     * @return
+     */
+    @Bean
+    public CaptchaClient captchaClient() {
+        //实例化一个认证对象,入参需要传入腾讯云账户 secretId,secretKey
+        Credential cred = new Credential(secretId, secretKey);
+
+        HttpProfile httpProfile = new HttpProfile();
+        httpProfile.setEndpoint(Constants.CAPTCHA_URL);
+
+        ClientProfile clientProfile = new ClientProfile();
+        clientProfile.setHttpProfile(httpProfile);
+
+        // 实例化要请求产品(captcha)的 client 对象
+        CaptchaClient client = new CaptchaClient(cred, "", clientProfile);
+
+        return client;
+    }
+}

+ 56 - 56
happy-boot-module-flexjob/src/main/java/org/jeecg/modules/hwuser/service/IHwUserService.java

@@ -1,56 +1,56 @@
-package org.jeecg.modules.hwuser.service;
-
-import com.baomidou.mybatisplus.core.conditions.Wrapper;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import org.jeecg.common.util.OtherException;
-import org.jeecg.modules.hwuser.entity.HwUser;
-import com.baomidou.mybatisplus.extension.service.IService;
-import org.jeecg.modules.ordermanager.entity.HwOrder;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @Description: hw_user
- * @Author: jeecg-boot
- * @Date:   2019-09-24
- * @Version: V1.0
- */
-public interface IHwUserService extends IService<HwUser> {
-
-    List<HwUser> findHwuser(String name, String phone, String idcardNumber);
-
-    Page<HwUser> pageList(Page<HwUser> pageList, HwUser hwUser,Wrapper queryWrapper);
-
-    List importExcel(MultipartFile file);
-
-    List<HwUser> findHwuser1(String name, String idcardNumber, String cardNumber);
-
-    Map<String,Object> sendMobileCode(HashMap<String,String> requestMap) throws OtherException;
-
-    Map<String,Object> getLoginApp(HashMap<String,String> requestMap, HttpServletRequest request);
-
-    HwUser getByPhone(String phone);
-
-    Map<String,Object> getHwUserInfo(Map<String,String> requestMap, HttpServletRequest request, HttpServletResponse response);
-
-    Map<String,Object> changeAvatar(HttpServletRequest request, HttpServletResponse response) throws IOException;
-
-    HwUser getByUserId(Integer userId);
-
-    void saveHwUser(HwUser hwUser);
-
-    boolean updateHwUser(HwUser hwUser);
-
-    List<HwUser> findListForAuth();
-
-    Page<HwUser> pageHainanUserInfoList(Page<HwUser> page, HwUser hwUser, QueryWrapper<HwUser> queryWrapper);
-
-    List<HwUser> findListForMoney(HwUser hwUser, QueryWrapper<HwUser> queryWrapper);
-}
+package org.jeecg.modules.hwuser.service;
+
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.jeecg.common.util.OtherException;
+import org.jeecg.modules.hwuser.entity.HwUser;
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.ordermanager.entity.HwOrder;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: hw_user
+ * @Author: jeecg-boot
+ * @Date: 2019-09-24
+ * @Version: V1.0
+ */
+public interface IHwUserService extends IService<HwUser> {
+
+    List<HwUser> findHwuser(String name, String phone, String idcardNumber);
+
+    Page<HwUser> pageList(Page<HwUser> pageList, HwUser hwUser, Wrapper queryWrapper);
+
+    List importExcel(MultipartFile file);
+
+    List<HwUser> findHwuser1(String name, String idcardNumber, String cardNumber);
+
+    Map<String, Object> sendMobileCode(HashMap<String, String> requestMap, HttpServletRequest request) throws OtherException;
+
+    Map<String, Object> getLoginApp(HashMap<String, String> requestMap, HttpServletRequest request);
+
+    HwUser getByPhone(String phone);
+
+    Map<String, Object> getHwUserInfo(Map<String, String> requestMap, HttpServletRequest request, HttpServletResponse response);
+
+    Map<String, Object> changeAvatar(HttpServletRequest request, HttpServletResponse response) throws IOException;
+
+    HwUser getByUserId(Integer userId);
+
+    void saveHwUser(HwUser hwUser);
+
+    boolean updateHwUser(HwUser hwUser);
+
+    List<HwUser> findListForAuth();
+
+    Page<HwUser> pageHainanUserInfoList(Page<HwUser> page, HwUser hwUser, QueryWrapper<HwUser> queryWrapper);
+
+    List<HwUser> findListForMoney(HwUser hwUser, QueryWrapper<HwUser> queryWrapper);
+}

Разница между файлами не показана из-за своего большого размера
+ 747 - 701
happy-boot-module-flexjob/src/main/java/org/jeecg/modules/hwuser/service/impl/HwUserServiceImpl.java


+ 100 - 0
happy-boot-module-flexjob/src/main/java/org/jeecg/modules/util/Constants.java

@@ -0,0 +1,100 @@
+package org.jeecg.modules.util;
+
+public interface Constants {
+
+    /********************微信小程序接口url************************/
+    /**
+     * 登录地址
+     */
+    public static final String MINA_GETSESSION_URL = "https://api.weixin.qq.com/sns/jscode2session?appid=APPID&secret=SECRET&js_code=JSCODE&grant_type=authorization_code";
+
+    /**
+     * 获取微信公众号/小程序:access_token的接口地址(GET) 限2000(次/天)
+     */
+    public static final String ACCESS_TOKEN_URL = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=APPID&secret=APPSECRET";
+
+    /********************微信服务号接口url************************/
+    /*** 菜单创建(POST) 限100(次/天)*/
+    public static final String MENU_CREATE_URL = "https://api.weixin.qq.com/cgi-bin/menu/create?access_token=ACCESS_TOKEN";
+    /***菜单查询*/
+    public static final String MENU_GET_URL = "https://api.weixin.qq.com/cgi-bin/menu/get?access_token=ACCESS_TOKEN";
+    /***菜单删除*/
+    public static final String MENU_DELETE_URL = "https://api.weixin.qq.com/cgi-bin/menu/delete?access_token=ACCESS_TOKEN";
+    /***微信发送消息url*/
+    public static final String SEND_MSG_URL = "https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=ACCESS_TOKEN";
+    /***获取用户信息*/
+    public static final String USERINFOR_URL = "https://api.weixin.qq.com/sns/userinfo?access_token=ACCESS_TOKEN&openid=OPENID&lang=zh_CN";
+    //微信发送模板消息url
+    public static String TEMPLATE_URL = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=ACCESS_TOKEN";
+
+    /**
+     * 接口只能生成已发布的小程序的二维码
+     * 接口 A 加上接口 C,总共生成的码数量限制为 100,000,请谨慎调用。
+     * 接口 B 调用分钟频率受限(5000次/分钟),如需大量小程序码,建议预生成。
+     */
+    /**
+     * 获取小程序二维码接口 A,适用于需要的码数量较少的业务场景。通过该接口生成的小程序码,永久有效,有数量限制
+     */
+    public static final String WX_APPLETS_GETWXACODE_URL = "https://api.weixin.qq.com/wxa/getwxacode?access_token=ACCESS_TOKEN";
+    /**
+     * 获取小程序码接口 C,适用于需要的码数量较少的业务场景。通过该接口生成的小程序码,永久有效,有数量限制
+     */
+    public static final String WX_APPLETS_CREATEWXAQRCODE_URL = "https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode?access_token=ACCESS_TOKEN";
+    /**
+     * 获取小程序码接口 B,适用于需要的码数量极多的业务场景。通过该接口生成的小程序码,永久有效,数量暂无限制
+     */
+    public static final String WX_APPLETS_GETWXACODEUNLIMIT_URL = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=ACCESS_TOKEN";
+
+    /********************app微信授权接口url************************/
+    //获取openid接口和用户access_token
+    public static String OPENID_URL = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=APPID&secret=APPSECRET&code=CODE&grant_type=authorization_code";
+    //验证access_token是否有效
+    public static String AUTH_URL = "https://api.weixin.qq.com/sns/auth?access_token=ACCESS_TOKEN&openid=OPENID";
+    //刷新access_token
+    public static String REFRESH_URL = "https://api.weixin.qq.com/sns/oauth2/refresh_token?appid=APPID&grant_type=refresh_token&refresh_token=REFRESH_TOKEN";
+
+    /***微信卡券接口中使用的签名凭证api_ticket*/
+    //public static final String JSAPI_URL = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=ACCESS_TOKEN&type=wx_card";
+    /***微信网页api_ticket*/
+    public static final String JSAPI_URL = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=ACCESS_TOKEN&type=jsapi";
+    /***下载媒体文件*/
+    public static String DOWNLOAD_MEDIA_URL = "https://api.weixin.qq.com/cgi-bin/media/get?access_token=ACCESS_TOKEN&media_id=MEDIA_ID";
+    /***上传媒体文件*/
+    public static String UPLOAD_MEDIA_URL = "https://api.weixin.qq.com/cgi-bin/media/upload?access_token=ACCESS_TOKEN&type=TYPE";
+
+
+    /********************腾讯云验证码接口请求域名************************/
+    public static final String CAPTCHA_URL = "captcha.tencentcloudapi.com";
+
+    /********************微信服务号返回码值msg************************/
+    public static final String ERRMSG_OK = "ok";
+    /**
+     * 菜单不存在
+     */
+    public static final String ERRMSG_NO_MENU = "menu no exist";
+    /**
+     * 成功
+     */
+    public static final String ERRCODE_0 = "0";
+
+    /**
+     * 微信access_token有效时长 (s)
+     */
+    public static final int WX_ACCESS_TOKEN_AGE = 7150;
+
+    // 编码类型
+    /**
+     * UTF-8
+     */
+    public static final String CODE_TYPE_STR = "utf-8";
+
+    // 小程序二维码宽度
+    public static final int HP_QRCODE_IMAGE_WIDTH = 430;
+
+    /********************腾讯云验证码接口返回状态************************/
+    /**
+     * OK 验证通过
+     */
+    public static final long CAPTCHA_CODE_OK = 1;
+
+}

+ 79 - 48
happy-boot-module-flexjob/src/main/java/org/jeecg/modules/util/TokenUtil.java

@@ -1,48 +1,79 @@
-package org.jeecg.modules.util;
-
-
-import org.jeecg.modules.hwuser.entity.HwUser;
-import org.jeecg.modules.hwuser.service.IHwUserService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-import javax.annotation.PostConstruct;
-
-/**
- * 微信授权的方法类
- * 对工具类进行扫描,加载IUserService对象bean
- */
-@Component
-public class TokenUtil {
-    @Autowired
-    private IHwUserService userService;
-
-    public static TokenUtil tokenUtil;
-
-    public static IHwUserService iUserService;
-
-    @PostConstruct
-    public void init() {
-        tokenUtil = this;
-        iUserService = userService;
-    }
-
-    /**
-     * 验证token有效性
-     *
-     * @param userId
-     * @param token
-     * @return
-     */
-    public static boolean validateToken(String userId, String token) {
-        try {
-            HwUser user = iUserService.getById(userId);
-            if (user != null) {
-                return token.equals(user.getUserToken());
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        return false;
-    }
-}
+package org.jeecg.modules.util;
+
+
+import com.tencentcloudapi.captcha.v20190722.CaptchaClient;
+import com.tencentcloudapi.captcha.v20190722.models.DescribeCaptchaResultRequest;
+import com.tencentcloudapi.captcha.v20190722.models.DescribeCaptchaResultResponse;
+import com.tencentcloudapi.common.exception.TencentCloudSDKException;
+import net.sf.json.JSONObject;
+import org.jeecg.modules.hwuser.entity.HwUser;
+import org.jeecg.modules.hwuser.service.IHwUserService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.PostConstruct;
+
+/**
+ * 微信授权的方法类
+ * 对工具类进行扫描,加载IUserService对象bean
+ */
+@Component
+public class TokenUtil {
+    @Autowired
+    private IHwUserService userService;
+    @Autowired
+    private CaptchaClient captchaClient;
+
+    public static TokenUtil tokenUtil;
+
+    public static IHwUserService iUserService;
+
+    public static CaptchaClient icaptchaClient;
+
+    @PostConstruct
+    public void init() {
+        tokenUtil = this;
+        iUserService = userService;
+        icaptchaClient = captchaClient;
+    }
+
+    /**
+     * 验证token有效性
+     *
+     * @param userId
+     * @param token
+     * @return
+     */
+    public static boolean validateToken(String userId, String token) {
+        try {
+            HwUser user = iUserService.getById(userId);
+            if (user != null) {
+                return token.equals(user.getUserToken());
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return false;
+    }
+
+    /**
+     * 腾讯云验证码票据验证
+     *
+     * @return
+     */
+    public static JSONObject checkTicket(JSONObject json) {
+        try {
+
+            String params = "{\"CaptchaType\":9,\"Ticket\":\"" + json.getString("Ticket") + "\",\"UserIp\":\"" + json.getString("UserIp") + "\",\"Randstr\":\"" + json.getString("Randstr") + "\",\"CaptchaAppId\":" + json.getInt("CaptchaAppId") + ",\"AppSecretKey\":\"" + json.getString("AppSecretKey") + "\"}";
+            // 实例化一个请求对象
+            DescribeCaptchaResultRequest req = DescribeCaptchaResultRequest.fromJsonString(params, DescribeCaptchaResultRequest.class);
+            // 通过 client 对象调用想要访问的接口,需要传入请求对象
+            DescribeCaptchaResultResponse resp = icaptchaClient.DescribeCaptchaResult(req);
+
+            return JSONObject.fromObject(DescribeCaptchaResultResponse.toJsonString(resp));
+        } catch (TencentCloudSDKException e) {
+            System.out.println(e.toString());
+        }
+        return null;
+    }
+}

+ 190 - 184
happy-boot-module-flexjob/src/main/resources/application-dev.yml

@@ -1,185 +1,191 @@
-server:
-  port: 8089
-  tomcat: 
-    max-swallow-size: -1
-  servlet:
-    context-path: /happy-boot
-  compression:
-    enabled: true
-    mime-types: application/javascript,application/json,application/xml,text/html,text/xml,text/plain,text/css,image/*
-        
-management:
- endpoints:
-  web:
-   exposure:
-    include: metrics,httptrace
-    
-spring:
-  servlet:
-     multipart: 
-        max-file-size: 100MB
-        max-request-size: 100MB
-  ## quartz定时任务,采用数据库方式
-  quartz:
-    job-store-type: jdbc
-  #json 时间戳统一转换
-  jackson:
-    date-format:   yyyy-MM-dd HH:mm:ss
-    time-zone:   GMT+8
-  aop:
-    proxy-target-class: true
-  #配置freemarker
-  freemarker:
-    # 设置模板后缀名
-    suffix: .ftl
-    # 设置文档类型
-    content-type: text/html
-    # 设置页面编码格式
-    charset: UTF-8
-    # 设置页面缓存
-    cache: false
-    prefer-file-system-access: false
-    # 设置ftl文件路径
-    template-loader-path:
-      - classpath:/templates
-  # 设置静态文件路径,js,css等
-  mvc:
-    static-path-pattern: /**
-  resource:
-    static-locations: classpath:/static/,classpath:/public/
-  autoconfigure:
-    exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
-  datasource:
-    druid:
-      stat-view-servlet:
-        enabled: true
-        loginUsername: admin
-        loginPassword: hp123456
-        allow:
-      web-stat-filter:
-        enabled: true
-    dynamic:
-      druid: # 全局druid参数,绝大部分值和默认保持一致。(现已支持的参数如下,不清楚含义不要乱设置)
-        # 连接池的配置信息
-        # 初始化大小,最小,最大
-        initial-size: 5
-        min-idle: 5
-        maxActive: 20
-        # 配置获取连接等待超时的时间
-        maxWait: 60000
-        # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
-        timeBetweenEvictionRunsMillis: 60000
-        # 配置一个连接在池中最小生存的时间,单位是毫秒
-        minEvictableIdleTimeMillis: 300000
-        validationQuery: SELECT 1 FROM DUAL
-        testWhileIdle: true
-        testOnBorrow: false
-        testOnReturn: false
-        # 打开PSCache,并且指定每个连接上PSCache的大小
-        poolPreparedStatements: true
-        maxPoolPreparedStatementPerConnectionSize: 20
-        # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
-        filters: stat,wall,slf4j
-        # 通过connectProperties属性来打开mergeSql功能;慢SQL记录
-        connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
-      datasource:
-        master:
-          url: jdbc:mysql://127.0.0.1:3306/hpwork?characterEncoding=UTF-8&useUnicode=true&useSSL=false
-          username: root
-          password: 123456
-          driver-class-name: com.mysql.jdbc.Driver
-          # 多数据源配置
-          #multi-datasource1:
-          #url: jdbc:mysql://localhost:3306/jeecg-boot2?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true
-          #username: root
-          #password: root
-          #driver-class-name: com.mysql.jdbc.Driver
-  #redis 配置
-  redis:
-    database: 6
-    host: 127.0.0.1
-    lettuce:
-      pool:
-        max-active: 8   #最大连接数据库连接数,设 0 为没有限制
-        max-idle: 8     #最大等待连接中的数量,设 0 为没有限制
-        max-wait: -1ms  #最大建立连接等待时间。如果超过此时间将接到异常。设为-1表示无限制。
-        min-idle: 0     #最小等待连接中的数量,设 0 为没有限制
-      shutdown-timeout: 100ms
-    password: '123456'
-    port: 6379
-#mybatis plus 设置
-mybatis-plus:
-  mapper-locations: classpath*:org/jeecg/modules/**/xml/*Mapper.xml
-  global-config:
-    # 关闭MP3.0自带的banner
-    banner: false
-    db-config:
-      #主键类型  0:"数据库ID自增",1:"该类型为未设置主键类型", 2:"用户输入ID",3:"全局唯一ID (数字类型唯一ID)", 4:"全局唯一ID UUID",5:"字符串全局唯一ID (idWorker 的字符串表示)";
-      id-type: 4
-      # 默认数据库表下划线命名
-      table-underline: true
-  configuration:
-     #这个配置会将执行的sql打印出来,在开发或测试的时候可以用
-    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
-#jeecg专用配置
-jeecg :
-  path :
-    #文件上传根目录 设置
-    upload: D://upFiles
-    #webapp文件路径
-    webapp: D://webapp
-    url: https://hw.hap-job.com
-  oss :
-    aliyunUrl: https://happyworktest.oss-cn-shanghai.aliyuncs.com
-    aliyunDownloadUrl: https://happyworktest.oss-cn-shanghai.aliyuncs.com
-    oSSUrl: https://happyworktest.oss-cn-shanghai.aliyuncs.com/static
-    endpoint: oss-cn-shanghai.aliyuncs.com
-    accessKeyId: LTAIdrFEg3iDHDzd
-    accessKeySecret: 72NuLZN12fVHLstI3iQdn13XGKSrpx
-    bucketName: happyworktest
-  sms :
-    #用户在253云通讯平台上申请的API账号  例如:N6000001
-    account: N3241700
-    #用户在253云通讯平台上申请的API账号对应的API密钥 例如:123456
-    password: O04MCJiBLc6b64
-    smsUrl: http://smssh1.253.com/msg/send/json
-    #253云通讯平台上配置签名
-    smsSign: '%e3%80%90%e5%bc%80%e5%bf%83%e7%81%b5%e5%b7%a5%e3%80%91'
-  #支付方式(0:正常支付;1:特殊支付(测试前置机))
-  payType: 1
-  pay :
-    #企业一网通用户ID
-    userid: Y100017433
-    #请求url
-    payurl: https://47.103.42.255:65369
-    #业务模式
-    busmod: '000001'
-    #交易代码(代发类型)
-    trstyp: AGPAY999
-    #代发协议
-    paycnv: AB0554
-  contract :
-    #企业管理员账号
-    adminAccount: E20021900002
-    #模板Id
-    templateId: MB158279025029226
-    #站点url
-    hostUrl: https://hrapi-16test.fadada.com/
-    appId: 100072
-    appSecret: dce8gB7fJ6gj5CFh8Hf7eGh2
-    companyId: c17af5d276094405bd0b437793f57648
-  #平台服务商银行卡信息
-  subcontractor:
-    bankInfo[0]:
-      bankName: '招商银行'
-      bankAddress: '江苏无锡'
-      bankAccount: '666666667777777'
-    bankInfo[1]:
-      bankName: '招商银行'
-      bankAddress: '江苏无锡'
-      bankAccount: '666666667777777'
-  #海南服务商id
-  subcontractorId: 1
-#cas单点登录
-cas:
+server:
+  port: 8089
+  tomcat: 
+    max-swallow-size: -1
+  servlet:
+    context-path: /happy-boot
+  compression:
+    enabled: true
+    mime-types: application/javascript,application/json,application/xml,text/html,text/xml,text/plain,text/css,image/*
+        
+management:
+ endpoints:
+  web:
+   exposure:
+    include: metrics,httptrace
+    
+spring:
+  servlet:
+     multipart: 
+        max-file-size: 100MB
+        max-request-size: 100MB
+  ## quartz定时任务,采用数据库方式
+  quartz:
+    job-store-type: jdbc
+  #json 时间戳统一转换
+  jackson:
+    date-format:   yyyy-MM-dd HH:mm:ss
+    time-zone:   GMT+8
+  aop:
+    proxy-target-class: true
+  #配置freemarker
+  freemarker:
+    # 设置模板后缀名
+    suffix: .ftl
+    # 设置文档类型
+    content-type: text/html
+    # 设置页面编码格式
+    charset: UTF-8
+    # 设置页面缓存
+    cache: false
+    prefer-file-system-access: false
+    # 设置ftl文件路径
+    template-loader-path:
+      - classpath:/templates
+  # 设置静态文件路径,js,css等
+  mvc:
+    static-path-pattern: /**
+  resource:
+    static-locations: classpath:/static/,classpath:/public/
+  autoconfigure:
+    exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
+  datasource:
+    druid:
+      stat-view-servlet:
+        enabled: true
+        loginUsername: admin
+        loginPassword: hp123456
+        allow:
+      web-stat-filter:
+        enabled: true
+    dynamic:
+      druid: # 全局druid参数,绝大部分值和默认保持一致。(现已支持的参数如下,不清楚含义不要乱设置)
+        # 连接池的配置信息
+        # 初始化大小,最小,最大
+        initial-size: 5
+        min-idle: 5
+        maxActive: 20
+        # 配置获取连接等待超时的时间
+        maxWait: 60000
+        # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+        timeBetweenEvictionRunsMillis: 60000
+        # 配置一个连接在池中最小生存的时间,单位是毫秒
+        minEvictableIdleTimeMillis: 300000
+        validationQuery: SELECT 1 FROM DUAL
+        testWhileIdle: true
+        testOnBorrow: false
+        testOnReturn: false
+        # 打开PSCache,并且指定每个连接上PSCache的大小
+        poolPreparedStatements: true
+        maxPoolPreparedStatementPerConnectionSize: 20
+        # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
+        filters: stat,wall,slf4j
+        # 通过connectProperties属性来打开mergeSql功能;慢SQL记录
+        connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
+      datasource:
+        master:
+          url: jdbc:mysql://127.0.0.1:3306/hpwork?characterEncoding=UTF-8&useUnicode=true&useSSL=false
+          username: root
+          password: 123456
+          driver-class-name: com.mysql.jdbc.Driver
+          # 多数据源配置
+          #multi-datasource1:
+          #url: jdbc:mysql://localhost:3306/jeecg-boot2?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true
+          #username: root
+          #password: root
+          #driver-class-name: com.mysql.jdbc.Driver
+  #redis 配置
+  redis:
+    database: 6
+    host: 127.0.0.1
+    lettuce:
+      pool:
+        max-active: 8   #最大连接数据库连接数,设 0 为没有限制
+        max-idle: 8     #最大等待连接中的数量,设 0 为没有限制
+        max-wait: -1ms  #最大建立连接等待时间。如果超过此时间将接到异常。设为-1表示无限制。
+        min-idle: 0     #最小等待连接中的数量,设 0 为没有限制
+      shutdown-timeout: 100ms
+    password: '123456'
+    port: 6379
+#mybatis plus 设置
+mybatis-plus:
+  mapper-locations: classpath*:org/jeecg/modules/**/xml/*Mapper.xml
+  global-config:
+    # 关闭MP3.0自带的banner
+    banner: false
+    db-config:
+      #主键类型  0:"数据库ID自增",1:"该类型为未设置主键类型", 2:"用户输入ID",3:"全局唯一ID (数字类型唯一ID)", 4:"全局唯一ID UUID",5:"字符串全局唯一ID (idWorker 的字符串表示)";
+      id-type: 4
+      # 默认数据库表下划线命名
+      table-underline: true
+  configuration:
+     #这个配置会将执行的sql打印出来,在开发或测试的时候可以用
+    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+#jeecg专用配置
+jeecg :
+  path :
+    #文件上传根目录 设置
+    upload: D://upFiles
+    #webapp文件路径
+    webapp: D://webapp
+    url: https://hw.hap-job.com
+  oss :
+    aliyunUrl: https://happyworktest.oss-cn-shanghai.aliyuncs.com
+    aliyunDownloadUrl: https://happyworktest.oss-cn-shanghai.aliyuncs.com
+    oSSUrl: https://happyworktest.oss-cn-shanghai.aliyuncs.com/static
+    endpoint: oss-cn-shanghai.aliyuncs.com
+    accessKeyId: LTAIdrFEg3iDHDzd
+    accessKeySecret: 72NuLZN12fVHLstI3iQdn13XGKSrpx
+    bucketName: happyworktest
+  sms :
+    #用户在253云通讯平台上申请的API账号  例如:N6000001
+    account: N3241700
+    #用户在253云通讯平台上申请的API账号对应的API密钥 例如:123456
+    password: O04MCJiBLc6b64
+    smsUrl: http://smssh1.253.com/msg/send/json
+    #253云通讯平台上配置签名
+    smsSign: '%e3%80%90%e5%bc%80%e5%bf%83%e7%81%b5%e5%b7%a5%e3%80%91'
+  #支付方式(0:正常支付;1:特殊支付(测试前置机))
+  payType: 1
+  pay :
+    #企业一网通用户ID
+    userid: Y100017433
+    #请求url
+    payurl: https://47.103.42.255:65369
+    #业务模式
+    busmod: '000001'
+    #交易代码(代发类型)
+    trstyp: AGPAY999
+    #代发协议
+    paycnv: AB0554
+  contract :
+    #企业管理员账号
+    adminAccount: E20021900002
+    #模板Id
+    templateId: MB158279025029226
+    #站点url
+    hostUrl: https://hrapi-16test.fadada.com/
+    appId: 100072
+    appSecret: dce8gB7fJ6gj5CFh8Hf7eGh2
+    companyId: c17af5d276094405bd0b437793f57648
+  #平台服务商银行卡信息
+  subcontractor:
+    bankInfo[0]:
+      bankName: '招商银行'
+      bankAddress: '江苏无锡'
+      bankAccount: '666666667777777'
+    bankInfo[1]:
+      bankName: '招商银行'
+      bankAddress: '江苏无锡'
+      bankAccount: '666666667777777'
+  #海南服务商id
+  subcontractorId: 1
+  #腾讯云验证码应用ID
+  tencent:
+    secretId: AKIDIH5dojPtDG2btwvfKiodAPxDfRvwR7FD
+    secretKey: ulOiodBRYO2SaT52h8HDrDeXYJm0xlQN
+    captchaAppId: 2072736870
+    captchaAppSecret: 02HfKJprDUkFdgAcErXdfog**
+#cas单点登录
+cas:
   prefixUrl: http://cas.example.org:8443/cas

+ 6 - 0
happy-boot-module-flexjob/src/main/resources/application-prod.yml

@@ -173,6 +173,12 @@ jeecg :
       bankAccount: '510903357710906'
   #海南服务商id
   subcontractorId: 3
+  #腾讯云验证码应用ID
+  tencent:
+    secretId: AKIDIH5dojPtDG2btwvfKiodAPxDfRvwR7FD
+    secretKey: ulOiodBRYO2SaT52h8HDrDeXYJm0xlQN
+    captchaAppId: 2078399419
+    captchaAppSecret: 0Mq3MIvB3sVB38uhU0b0lQQ**
 #cas单点登录
 cas:
   prefixUrl: http://cas.example.org:8443/cas

+ 189 - 183
happy-boot-module-flexjob/src/main/resources/application-test.yml

@@ -1,184 +1,190 @@
-server:
-    port: 18053
-    tomcat: 
-        max-swallow-size: -1
-    servlet:
-       context-path: /happy-boot
-    compression:
-       enabled: true
-       mime-types: application/javascript,application/json,application/xml,text/html,text/xml,text/plain,text/css,image/*
-        
-management:
- endpoints:
-  web:
-   exposure:
-    include: metrics,httptrace
-    
-spring:
-  servlet:
-     multipart: 
-        max-file-size: 100MB
-        max-request-size: 100MB
-  ## quartz定时任务,采用数据库方式
-  quartz:
-     job-store-type: jdbc
-  #json 时间戳统一转换
-  jackson:
-    date-format:   yyyy-MM-dd HH:mm:ss
-    time-zone:   GMT+8
-  aop:
-    proxy-target-class: true
-  #配置freemarker
-  freemarker:
-    # 设置模板后缀名
-    suffix: .ftl
-    # 设置文档类型
-    content-type: text/html
-    # 设置页面编码格式
-    charset: UTF-8
-    # 设置页面缓存
-    cache: false
-    prefer-file-system-access: false
-    # 设置ftl文件路径
-    template-loader-path:
-      - classpath:/templates
-  # 设置静态文件路径,js,css等
-  mvc:
-    static-path-pattern: /**
-  resource: 
-    static-locations: classpath:/static/,classpath:/public/
-  autoconfigure:
-    exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
-  datasource:
-    druid:
-      stat-view-servlet:
-        enabled: true
-        loginUsername: admin
-        loginPassword: hp123456
-        allow:
-      web-stat-filter:
-        enabled: true
-    dynamic: 
-      druid: # 全局druid参数,绝大部分值和默认保持一致。(现已支持的参数如下,不清楚含义不要乱设置)
-        # 连接池的配置信息
-        # 初始化大小,最小,最大
-        initial-size: 5
-        min-idle: 5
-        maxActive: 20
-        # 配置获取连接等待超时的时间
-        maxWait: 60000
-        # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
-        timeBetweenEvictionRunsMillis: 60000
-        # 配置一个连接在池中最小生存的时间,单位是毫秒
-        minEvictableIdleTimeMillis: 300000
-        validationQuery: SELECT 1 FROM DUAL
-        testWhileIdle: true
-        testOnBorrow: false
-        testOnReturn: false
-        # 打开PSCache,并且指定每个连接上PSCache的大小
-        poolPreparedStatements: true
-        maxPoolPreparedStatementPerConnectionSize: 20
-        # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
-        filters: stat,wall,slf4j
-        # 通过connectProperties属性来打开mergeSql功能;慢SQL记录
-        connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
-      datasource: 
-          master: 
-            url: jdbc:mysql://127.0.0.1:3306/happywork?characterEncoding=UTF-8&useUnicode=true&useSSL=false
-            username: happyworktest
-            password: 5k_5gCHLHW
-            driver-class-name: com.mysql.jdbc.Driver
-          # 多数据源配置   
-          #multi-datasource1: 
-            #url: jdbc:mysql://localhost:3306/jeecg-boot2?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true
-            #username: root
-            #password: root
-            #driver-class-name: com.mysql.jdbc.Driver
-  #redis 配置
-  redis:
-     database: 6
-     host: 127.0.0.1
-     lettuce:
-       pool:
-         max-active: 8   #最大连接数据库连接数,设 0 为没有限制
-         max-idle: 8     #最大等待连接中的数量,设 0 为没有限制
-         max-wait: -1ms  #最大建立连接等待时间。如果超过此时间将接到异常。设为-1表示无限制。
-         min-idle: 0     #最小等待连接中的数量,设 0 为没有限制
-       shutdown-timeout: 100ms
-     password: 'zX$l5c8QNAQH$l25HKWORK'
-     port: 18369
-#mybatis plus 设置
-mybatis-plus:
-   mapper-locations: classpath*:org/jeecg/modules/**/xml/*Mapper.xml
-   global-config:
-     # 关闭MP3.0自带的banner
-     banner: false
-     db-config:
-       #主键类型  0:"数据库ID自增",1:"该类型为未设置主键类型", 2:"用户输入ID",3:"全局唯一ID (数字类型唯一ID)", 4:"全局唯一ID UUID",5:"字符串全局唯一ID (idWorker 的字符串表示)";
-       id-type: 4
-       # 默认数据库表下划线命名
-       table-underline: true
-   configuration:
-     #这个配置会将执行的sql打印出来,在开发或测试的时候可以用
-     log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
-#jeecg专用配置
-jeecg :
-  path :
-    #文件上传根目录 设置
-    upload: /opt/happy-boot/upload
-    #webapp文件路径
-    webapp: /opt/happy-boot/webapp
-    url: https://hw.hap-job.com
-  oss :
-    aliyunUrl: https://happyworktest.oss-cn-shanghai.aliyuncs.com
-    aliyunDownloadUrl: https://happyworktest.oss-cn-shanghai.aliyuncs.com
-    oSSUrl: https://happyworktest.oss-cn-shanghai.aliyuncs.com/static
-    endpoint: oss-cn-shanghai.aliyuncs.com
-    accessKeyId: LTAIdrFEg3iDHDzd
-    accessKeySecret: 72NuLZN12fVHLstI3iQdn13XGKSrpx
-    bucketName: happyworktest
-  sms :
-    #用户在253云通讯平台上申请的API账号  例如:N6000001
-    account: N3241700
-    #用户在253云通讯平台上申请的API账号对应的API密钥 例如:123456
-    password: O04MCJiBLc6b64
-    smsUrl: http://smssh1.253.com/msg/send/json
-    #253云通讯平台上配置签名
-    smsSign: '%e3%80%90%e5%bc%80%e5%bf%83%e7%81%b5%e5%b7%a5%e3%80%91'
-  #支付方式(0:正常支付;1:特殊支付(测试前置机))
-  payType: 1
-  pay :
-    #企业一网通用户ID
-    userid: Y100017433
-    #请求url
-    payurl: https://47.103.42.255:65369
-    #业务模式
-    busmod: '000001'
-    #交易代码(代发类型)
-    trstyp: AGPAY999
-    #代发协议
-    paycnv: AB0554
-  contract :
-    #企业管理员账号
-    adminAccount: E20021900002
-    #模板Id
-    templateId: MB158279025029226
-    #站点url
-    hostUrl: https://hrapi-16test.fadada.com/
-    appId: 100072
-    appSecret: dce8gB7fJ6gj5CFh8Hf7eGh2
-    companyId: c17af5d276094405bd0b437793f57648
-  #平台服务商银行卡信息
-  subcontractor:
-    bankInfo[0]:
-      bankName: '招商银行'
-      bankAddress: '无锡市新区支行'
-      bankAccount: '510903357710906'
-  #海南服务商id
-  subcontractorId: 2
-logging:
-  level:
-    org.jeecg.modules.system.mapper : debug
-#cas单点登录
-cas:
+server:
+    port: 18053
+    tomcat: 
+        max-swallow-size: -1
+    servlet:
+       context-path: /happy-boot
+    compression:
+       enabled: true
+       mime-types: application/javascript,application/json,application/xml,text/html,text/xml,text/plain,text/css,image/*
+        
+management:
+ endpoints:
+  web:
+   exposure:
+    include: metrics,httptrace
+    
+spring:
+  servlet:
+     multipart: 
+        max-file-size: 100MB
+        max-request-size: 100MB
+  ## quartz定时任务,采用数据库方式
+  quartz:
+     job-store-type: jdbc
+  #json 时间戳统一转换
+  jackson:
+    date-format:   yyyy-MM-dd HH:mm:ss
+    time-zone:   GMT+8
+  aop:
+    proxy-target-class: true
+  #配置freemarker
+  freemarker:
+    # 设置模板后缀名
+    suffix: .ftl
+    # 设置文档类型
+    content-type: text/html
+    # 设置页面编码格式
+    charset: UTF-8
+    # 设置页面缓存
+    cache: false
+    prefer-file-system-access: false
+    # 设置ftl文件路径
+    template-loader-path:
+      - classpath:/templates
+  # 设置静态文件路径,js,css等
+  mvc:
+    static-path-pattern: /**
+  resource: 
+    static-locations: classpath:/static/,classpath:/public/
+  autoconfigure:
+    exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
+  datasource:
+    druid:
+      stat-view-servlet:
+        enabled: true
+        loginUsername: admin
+        loginPassword: hp123456
+        allow:
+      web-stat-filter:
+        enabled: true
+    dynamic: 
+      druid: # 全局druid参数,绝大部分值和默认保持一致。(现已支持的参数如下,不清楚含义不要乱设置)
+        # 连接池的配置信息
+        # 初始化大小,最小,最大
+        initial-size: 5
+        min-idle: 5
+        maxActive: 20
+        # 配置获取连接等待超时的时间
+        maxWait: 60000
+        # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+        timeBetweenEvictionRunsMillis: 60000
+        # 配置一个连接在池中最小生存的时间,单位是毫秒
+        minEvictableIdleTimeMillis: 300000
+        validationQuery: SELECT 1 FROM DUAL
+        testWhileIdle: true
+        testOnBorrow: false
+        testOnReturn: false
+        # 打开PSCache,并且指定每个连接上PSCache的大小
+        poolPreparedStatements: true
+        maxPoolPreparedStatementPerConnectionSize: 20
+        # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
+        filters: stat,wall,slf4j
+        # 通过connectProperties属性来打开mergeSql功能;慢SQL记录
+        connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
+      datasource: 
+          master: 
+            url: jdbc:mysql://127.0.0.1:3306/happywork?characterEncoding=UTF-8&useUnicode=true&useSSL=false
+            username: happyworktest
+            password: 5k_5gCHLHW
+            driver-class-name: com.mysql.jdbc.Driver
+          # 多数据源配置   
+          #multi-datasource1: 
+            #url: jdbc:mysql://localhost:3306/jeecg-boot2?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true
+            #username: root
+            #password: root
+            #driver-class-name: com.mysql.jdbc.Driver
+  #redis 配置
+  redis:
+     database: 6
+     host: 127.0.0.1
+     lettuce:
+       pool:
+         max-active: 8   #最大连接数据库连接数,设 0 为没有限制
+         max-idle: 8     #最大等待连接中的数量,设 0 为没有限制
+         max-wait: -1ms  #最大建立连接等待时间。如果超过此时间将接到异常。设为-1表示无限制。
+         min-idle: 0     #最小等待连接中的数量,设 0 为没有限制
+       shutdown-timeout: 100ms
+     password: 'zX$l5c8QNAQH$l25HKWORK'
+     port: 18369
+#mybatis plus 设置
+mybatis-plus:
+   mapper-locations: classpath*:org/jeecg/modules/**/xml/*Mapper.xml
+   global-config:
+     # 关闭MP3.0自带的banner
+     banner: false
+     db-config:
+       #主键类型  0:"数据库ID自增",1:"该类型为未设置主键类型", 2:"用户输入ID",3:"全局唯一ID (数字类型唯一ID)", 4:"全局唯一ID UUID",5:"字符串全局唯一ID (idWorker 的字符串表示)";
+       id-type: 4
+       # 默认数据库表下划线命名
+       table-underline: true
+   configuration:
+     #这个配置会将执行的sql打印出来,在开发或测试的时候可以用
+     log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+#jeecg专用配置
+jeecg :
+  path :
+    #文件上传根目录 设置
+    upload: /opt/happy-boot/upload
+    #webapp文件路径
+    webapp: /opt/happy-boot/webapp
+    url: https://hw.hap-job.com
+  oss :
+    aliyunUrl: https://happyworktest.oss-cn-shanghai.aliyuncs.com
+    aliyunDownloadUrl: https://happyworktest.oss-cn-shanghai.aliyuncs.com
+    oSSUrl: https://happyworktest.oss-cn-shanghai.aliyuncs.com/static
+    endpoint: oss-cn-shanghai.aliyuncs.com
+    accessKeyId: LTAIdrFEg3iDHDzd
+    accessKeySecret: 72NuLZN12fVHLstI3iQdn13XGKSrpx
+    bucketName: happyworktest
+  sms :
+    #用户在253云通讯平台上申请的API账号  例如:N6000001
+    account: N3241700
+    #用户在253云通讯平台上申请的API账号对应的API密钥 例如:123456
+    password: O04MCJiBLc6b64
+    smsUrl: http://smssh1.253.com/msg/send/json
+    #253云通讯平台上配置签名
+    smsSign: '%e3%80%90%e5%bc%80%e5%bf%83%e7%81%b5%e5%b7%a5%e3%80%91'
+  #支付方式(0:正常支付;1:特殊支付(测试前置机))
+  payType: 1
+  pay :
+    #企业一网通用户ID
+    userid: Y100017433
+    #请求url
+    payurl: https://47.103.42.255:65369
+    #业务模式
+    busmod: '000001'
+    #交易代码(代发类型)
+    trstyp: AGPAY999
+    #代发协议
+    paycnv: AB0554
+  contract :
+    #企业管理员账号
+    adminAccount: E20021900002
+    #模板Id
+    templateId: MB158279025029226
+    #站点url
+    hostUrl: https://hrapi-16test.fadada.com/
+    appId: 100072
+    appSecret: dce8gB7fJ6gj5CFh8Hf7eGh2
+    companyId: c17af5d276094405bd0b437793f57648
+  #平台服务商银行卡信息
+  subcontractor:
+    bankInfo[0]:
+      bankName: '招商银行'
+      bankAddress: '无锡市新区支行'
+      bankAccount: '510903357710906'
+  #海南服务商id
+  subcontractorId: 2
+  #腾讯云验证码应用ID
+  tencent:
+    secretId: AKIDIH5dojPtDG2btwvfKiodAPxDfRvwR7FD
+    secretKey: ulOiodBRYO2SaT52h8HDrDeXYJm0xlQN
+    captchaAppId: 2072736870
+    captchaAppSecret: 02HfKJprDUkFdgAcErXdfog**
+logging:
+  level:
+    org.jeecg.modules.system.mapper : debug
+#cas单点登录
+cas:
   prefixUrl: http://cas.example.org:8443/cas