Merge remote-tracking branch 'origin/branch2022-1-4' into branch2022-1-4
This commit is contained in:
+10
-1
@@ -14,6 +14,8 @@ import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.util.*;
|
||||
import com.jero.company.entity.PayCompanyManagement;
|
||||
import com.jero.company.entity.PayContactsManagement;
|
||||
import com.jero.company.entity.WxSecret;
|
||||
import com.jero.company.mapper.WxSecretMapper;
|
||||
import com.jero.company.service.IPayCompanyManagementService;
|
||||
import com.jero.company.service.IPayContactsManagementService;
|
||||
import com.jero.company.vo.CompanyLoginVO;
|
||||
@@ -61,6 +63,8 @@ public class CompanyLoginController {
|
||||
private ISysDictService sysDictService;
|
||||
@Resource
|
||||
private BaseCommonService baseCommonService;
|
||||
@Resource
|
||||
private WxSecretMapper wxSecretMapper;
|
||||
@Value("${defaultPassword}")
|
||||
private String defaultPassword;
|
||||
/**
|
||||
@@ -257,7 +261,12 @@ public class CompanyLoginController {
|
||||
*/
|
||||
@ApiOperation("微信登录凭证校验")
|
||||
@GetMapping(value = "/jscode2session")
|
||||
public Result<JSONObject> jscode2session(Jscode2sessionVO jscode2sessionVO) {
|
||||
public Result<JSONObject> jscode2session(Jscode2sessionVO jscode2sessionVO,String type) {
|
||||
QueryWrapper<WxSecret> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("login_type",type);
|
||||
WxSecret wxSecret = wxSecretMapper.selectOne(wrapper);
|
||||
String secret = PasswordUtil.decrypt(wxSecret.getSecret());
|
||||
jscode2sessionVO.setSecret(secret);
|
||||
Map hashMap = JSONObject.parseObject(JSONObject.toJSONString(jscode2sessionVO), Map.class);
|
||||
String result = HttpUtil.get("https://api.weixin.qq.com/sns/jscode2session",hashMap);
|
||||
return Result.OK(JSONObject.parseObject(result));
|
||||
|
||||
+2
-1
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.jero.common.aspect.annotation.Dict;
|
||||
import com.jero.common.util.superSearch.ConstantUtils;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
@@ -78,7 +79,7 @@ public class PayContactsManagement implements Serializable {
|
||||
@Excel(name = "手机号", width = 15)
|
||||
@ApiModelProperty(value = "手机号")
|
||||
@NotEmpty(message = "手机号不能为空")
|
||||
@Pattern(regexp = "^((13[0-9])|(14[579])|(15([0-3]|[5-9]))|(17[0135678])|(18[0-9])|(19[8|9])|(16[6]))\\d{8}$",message = "手机号格式错误")
|
||||
@Pattern(regexp = ConstantUtils.TEL_PHONE,message = "手机号格式错误")
|
||||
private String phone;
|
||||
/**邮箱*/
|
||||
@Excel(name = "邮箱", width = 15)
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.jero.company.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author liJiaRao
|
||||
* @date 2022-01-19 13:56
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "wx_secret")
|
||||
public class WxSecret {
|
||||
@TableField(value = "login_type")
|
||||
private String loginType;
|
||||
|
||||
@TableField(value = "secret")
|
||||
private String secret;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.jero.company.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jero.company.entity.WxSecret;
|
||||
|
||||
/**
|
||||
* @author liJiaRao
|
||||
* @date 2022-01-19 13:56
|
||||
*/
|
||||
public interface WxSecretMapper extends BaseMapper<WxSecret> {
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jero.company.mapper.WxSecretMapper">
|
||||
<resultMap id="BaseResultMap" type="com.jero.company.entity.WxSecret">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table wx_secret-->
|
||||
<result column="login_type" jdbcType="VARCHAR" property="loginType" />
|
||||
<result column="secret" jdbcType="VARCHAR" property="secret" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
login_type, secret
|
||||
</sql>
|
||||
</mapper>
|
||||
@@ -2,6 +2,7 @@ package com.jero.company.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.jero.common.util.superSearch.ConstantUtils;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
@@ -19,7 +20,7 @@ public class CompanyLoginVO {
|
||||
/**手机号*/
|
||||
@ApiModelProperty(value = "手机号")
|
||||
@NotEmpty(message = "手机号不能为空!")
|
||||
@Pattern(regexp = "^((13[0-9])|(14[579])|(15([0-3]|[5-9]))|(17[0135678])|(18[0-9])|(19[8|9])|(16[6]))\\d{8}$",message = "手机号码格式错误")
|
||||
@Pattern(regexp = ConstantUtils.TEL_PHONE,message = "手机号码格式错误")
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user