微信授权登录

master
胡锐 4 weeks ago
parent 7470b83bfb
commit 723f935138
  1. 10
      bweb/src/main/resources/prod/application.yml
  2. 47
      cweb/src/main/java/com/hfkj/controller/ClientController.java
  3. 57
      cweb/src/main/java/com/hfkj/controller/UserController.java
  4. 12
      cweb/src/main/resources/prod/application.yml
  5. 12
      schedule/src/main/resources/prod/application.yml
  6. 37
      service/src/main/java/com/hfkj/dao/BsUserMapper.java
  7. 42
      service/src/main/java/com/hfkj/dao/BsUserSqlProvider.java
  8. 48
      service/src/main/java/com/hfkj/entity/BsUser.java
  9. 210
      service/src/main/java/com/hfkj/entity/BsUserExample.java
  10. 2
      service/src/main/java/com/hfkj/service/partner/Impl/PartnerServiceImpl.java
  11. 4
      service/src/main/java/com/hfkj/service/user/BsUserGradeService.java
  12. 20
      service/src/main/java/com/hfkj/service/user/BsUserService.java
  13. 14
      service/src/main/java/com/hfkj/service/user/impl/BsUserGradeServiceImpl.java
  14. 81
      service/src/main/java/com/hfkj/service/user/impl/BsUserServiceImpl.java
  15. 2
      service/src/main/java/com/hfkj/sysenum/user/UserLoginType.java

@ -1,5 +1,5 @@
server: server:
port: 9302 port: 9102
servlet: servlet:
context-path: /brest context-path: /brest
@ -9,9 +9,9 @@ debug: false
#datasource数据源设置 #datasource数据源设置
spring: spring:
datasource: datasource:
url: jdbc:mysql://127.0.0.1:3306/hsg?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8 url: jdbc:mysql://127.0.0.1:3306/youtao?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: root username: yqyt
password: HF123456. password: yqyt123!@#Mysql
type: com.alibaba.druid.pool.DruidDataSource type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.jdbc.Driver driver-class-name: com.mysql.jdbc.Driver
filters: stat filters: stat
@ -31,7 +31,7 @@ spring:
database: 0 database: 0
host: 127.0.0.1 host: 127.0.0.1
port: 36379 port: 36379
password: HF123456.Redis password: yqyt123!@#Redis
timeout: 1000 timeout: 1000
jedis: jedis:
pool: pool:

@ -5,9 +5,11 @@ import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp; import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode; import com.hfkj.common.exception.SysCode;
import com.hfkj.common.security.UserCenter; import com.hfkj.common.security.UserCenter;
import com.hfkj.common.utils.HttpsUtils;
import com.hfkj.common.utils.MemberValidateUtil; import com.hfkj.common.utils.MemberValidateUtil;
import com.hfkj.common.utils.RedisUtil; import com.hfkj.common.utils.RedisUtil;
import com.hfkj.common.utils.ResponseMsgUtil; import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.entity.BsUser;
import com.hfkj.model.ResponseData; import com.hfkj.model.ResponseData;
import com.hfkj.model.SecUserSessionObject; import com.hfkj.model.SecUserSessionObject;
import com.hfkj.service.user.BsUserService; import com.hfkj.service.user.BsUserService;
@ -22,6 +24,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map;
/** /**
* @className: ClientController * @className: ClientController
@ -78,22 +81,42 @@ public class ClientController {
} }
} }
@RequestMapping(value = "/weChat", method = RequestMethod.POST)
@RequestMapping(value = "/smsLogin", method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "登录并注册") @ApiOperation(value = "微信授权登录")
public ResponseData smsLogin(@RequestParam(value = "phone" , required = true) String phone) { public ResponseData weChat(@RequestBody JSONObject body) {
try { try {
if (body == null || StringUtils.isBlank(body.getString("code"))) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
// 校验手机号格式
if (!MemberValidateUtil.validatePhone(phone)) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请输入正确的手机号");
} }
// 邀请人id
Long inviteUseId = body.getLong("inviteUseId");
Map<String, Object> params = new HashMap<>();
return ResponseMsgUtil.success(userService.login(phone, UserLoginType.SMS, new HashMap<>(), null)); params.put("appid", "wxa075e8509802f826");
params.put("secret", "0e606fc1378d35e359fcf3f15570b2c5");
params.put("code", body.getString("code"));
params.put("grant_type", "authorization_code");
JSONObject accessToken = HttpsUtils.doGet("https://api.weixin.qq.com/sns/oauth2/access_token", params);
if (accessToken == null || StringUtils.isBlank(accessToken.getString("openid"))) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "授权失败");
}
params.clear();
params.put("access_token", accessToken.getString("access_token"));
params.put("openid", accessToken.getString("openid"));
params.put("lang", "zh_CN");
JSONObject userinfo = HttpsUtils.doGet("https://api.weixin.qq.com/sns/userinfo", params);
if (userinfo == null || StringUtils.isBlank(userinfo.getString("openid"))) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "获取用户信息失败");
}
BsUser user = new BsUser();
user.setHeadImg(userinfo.getString("headimgurl"));
user.setName(userinfo.getString("nickname"));
user.setWechatOpenId(userinfo.getString("openid"));
user.setWechatUnionid(userinfo.getString("unionid"));
userService.weChatAuth(user, new HashMap<>(), inviteUseId);
return ResponseMsgUtil.success(userinfo);
} catch (Exception e) { } catch (Exception e) {
return ResponseMsgUtil.exception(e); return ResponseMsgUtil.exception(e);
} }

@ -6,10 +6,7 @@ import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp; import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode; import com.hfkj.common.exception.SysCode;
import com.hfkj.common.security.UserCenter; import com.hfkj.common.security.UserCenter;
import com.hfkj.common.utils.DateUtil; import com.hfkj.common.utils.*;
import com.hfkj.common.utils.MemberValidateUtil;
import com.hfkj.common.utils.RedisUtil;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.config.CommonSysConst; import com.hfkj.config.CommonSysConst;
import com.hfkj.config.SysConfig; import com.hfkj.config.SysConfig;
import com.hfkj.entity.BsUser; import com.hfkj.entity.BsUser;
@ -205,9 +202,13 @@ public class UserController {
if (StringUtils.isBlank(body.getString("smsCode"))) { if (StringUtils.isBlank(body.getString("smsCode"))) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请输入短信验证码"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请输入短信验证码");
} }
if (userService.getUser(phone) != null) { // 手机号用户
BsUser user = userService.getUser(phone);
if (user != null) {
if (StringUtils.isNotBlank(user.getWechatOpenId())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "手机号已被绑定"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "手机号已被绑定");
} }
}
// 手机号的验证码 // 手机号的验证码
Object phoneCodeObject = redisUtil.get("SMS_BIND_PHONE_CODE:" + phone); Object phoneCodeObject = redisUtil.get("SMS_BIND_PHONE_CODE:" + phone);
if (phoneCodeObject == null) { if (phoneCodeObject == null) {
@ -294,9 +295,13 @@ public class UserController {
if (userSession.getUser().getPhone().equals(phone)) { if (userSession.getUser().getPhone().equals(phone)) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "新手机号与现绑定手机号相同"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "新手机号与现绑定手机号相同");
} }
if (userService.getUser(phone) != null) { // 手机号用户
BsUser user = userService.getUser(phone);
if (user != null) {
if (StringUtils.isNotBlank(user.getWechatOpenId())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "手机号已被绑定"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "手机号已被绑定");
} }
}
// 校验手机号格式 // 校验手机号格式
if (!MemberValidateUtil.validatePhone(phone)) { if (!MemberValidateUtil.validatePhone(phone)) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请输入正确的手机号"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请输入正确的手机号");
@ -324,6 +329,46 @@ public class UserController {
} }
} }
@RequestMapping(value = "/bindWeChat", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "绑定微信")
public ResponseData bindWeChat(@RequestBody JSONObject body) {
try {
if (body == null || StringUtils.isBlank(body.getString("code"))) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
UserSessionObject userSession = userCenter.getSessionModel(UserSessionObject.class);
if (StringUtils.isNotBlank(userSession.getUser().getWechatOpenId())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "已绑定过微信");
}
Map<String, Object> params = new HashMap<>();
params.put("appid", "wxa075e8509802f826");
params.put("secret", "0e606fc1378d35e359fcf3f15570b2c5");
params.put("code", body.getString("code"));
params.put("grant_type", "authorization_code");
JSONObject accessToken = HttpsUtils.doGet("https://api.weixin.qq.com/sns/oauth2/access_token", params);
if (accessToken == null || StringUtils.isBlank(accessToken.getString("openid"))) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "授权失败");
}
params.clear();
params.put("access_token", accessToken.getString("access_token"));
params.put("openid", accessToken.getString("openid"));
params.put("lang", "zh_CN");
JSONObject userinfo = HttpsUtils.doGet("https://api.weixin.qq.com/sns/userinfo", params);
if (userinfo == null || StringUtils.isBlank(userinfo.getString("openid"))) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "获取用户信息失败");
}
BsUser user = userSession.getUser();
user.setWechatOpenId(userinfo.getString("openid"));
user.setWechatUnionid(userinfo.getString("unionid"));
userService.updateInfo(user);
return ResponseMsgUtil.success(userCenter.getSessionModel(UserSessionObject.class));
} catch (Exception e) {
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/delete", method = RequestMethod.POST) @RequestMapping(value = "/delete", method = RequestMethod.POST)
@ResponseBody @ResponseBody
@ApiOperation(value = "注销账户") @ApiOperation(value = "注销账户")

@ -1,7 +1,7 @@
server: server:
port: 9302 port: 9101
servlet: servlet:
context-path: /brest context-path: /crest
#配置是否为debug模式,debug模式下,不开启权限校验 #配置是否为debug模式,debug模式下,不开启权限校验
debug: false debug: false
@ -9,9 +9,9 @@ debug: false
#datasource数据源设置 #datasource数据源设置
spring: spring:
datasource: datasource:
url: jdbc:mysql://127.0.0.1:3306/hsg?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8 url: jdbc:mysql://127.0.0.1:3306/youtao?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: root username: yqyt
password: HF123456. password: yqyt123!@#Mysql
type: com.alibaba.druid.pool.DruidDataSource type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.jdbc.Driver driver-class-name: com.mysql.jdbc.Driver
filters: stat filters: stat
@ -31,7 +31,7 @@ spring:
database: 0 database: 0
host: 127.0.0.1 host: 127.0.0.1
port: 36379 port: 36379
password: HF123456.Redis password: yqyt123!@#Redis
timeout: 1000 timeout: 1000
jedis: jedis:
pool: pool:

@ -1,7 +1,7 @@
server: server:
port: 9302 port: 9103
servlet: servlet:
context-path: /brest context-path: /schedule
#配置是否为debug模式,debug模式下,不开启权限校验 #配置是否为debug模式,debug模式下,不开启权限校验
debug: false debug: false
@ -9,9 +9,9 @@ debug: false
#datasource数据源设置 #datasource数据源设置
spring: spring:
datasource: datasource:
url: jdbc:mysql://127.0.0.1:3306/hsg?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8 url: jdbc:mysql://127.0.0.1:3306/youtao?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: root username: yqyt
password: HF123456. password: yqyt123!@#Mysql
type: com.alibaba.druid.pool.DruidDataSource type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.jdbc.Driver driver-class-name: com.mysql.jdbc.Driver
filters: stat filters: stat
@ -31,7 +31,7 @@ spring:
database: 0 database: 0
host: 127.0.0.1 host: 127.0.0.1
port: 36379 port: 36379
password: HF123456.Redis password: yqyt123!@#Redis
timeout: 1000 timeout: 1000
jedis: jedis:
pool: pool:

@ -41,18 +41,20 @@ public interface BsUserMapper extends BsUserMapperExt {
@Insert({ @Insert({
"insert into bs_user (head_img, `name`, ", "insert into bs_user (head_img, `name`, ",
"phone, grade, wechat_num, ", "phone, grade, wechat_num, ",
"invite_user_id, invite_time, ", "wechat_open_id, wechat_unionid, ",
"partner_level, partner_income_per, ", "elm_pid, invite_user_id, ",
"`status`, create_time, ", "invite_time, partner_level, ",
"update_time, ext_1, ", "partner_income_per, `status`, ",
"ext_2, ext_3)", "create_time, update_time, ",
"ext_1, ext_2, ext_3)",
"values (#{headImg,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, ", "values (#{headImg,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, ",
"#{phone,jdbcType=VARCHAR}, #{grade,jdbcType=INTEGER}, #{wechatNum,jdbcType=VARCHAR}, ", "#{phone,jdbcType=VARCHAR}, #{grade,jdbcType=INTEGER}, #{wechatNum,jdbcType=VARCHAR}, ",
"#{inviteUserId,jdbcType=BIGINT}, #{inviteTime,jdbcType=TIMESTAMP}, ", "#{wechatOpenId,jdbcType=VARCHAR}, #{wechatUnionid,jdbcType=VARCHAR}, ",
"#{partnerLevel,jdbcType=INTEGER}, #{partnerIncomePer,jdbcType=DECIMAL}, ", "#{elmPid,jdbcType=VARCHAR}, #{inviteUserId,jdbcType=BIGINT}, ",
"#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ", "#{inviteTime,jdbcType=TIMESTAMP}, #{partnerLevel,jdbcType=INTEGER}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ", "#{partnerIncomePer,jdbcType=DECIMAL}, #{status,jdbcType=INTEGER}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
}) })
@Options(useGeneratedKeys=true,keyProperty="id") @Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsUser record); int insert(BsUser record);
@ -69,6 +71,9 @@ public interface BsUserMapper extends BsUserMapperExt {
@Result(column="phone", property="phone", jdbcType=JdbcType.VARCHAR), @Result(column="phone", property="phone", jdbcType=JdbcType.VARCHAR),
@Result(column="grade", property="grade", jdbcType=JdbcType.INTEGER), @Result(column="grade", property="grade", jdbcType=JdbcType.INTEGER),
@Result(column="wechat_num", property="wechatNum", jdbcType=JdbcType.VARCHAR), @Result(column="wechat_num", property="wechatNum", jdbcType=JdbcType.VARCHAR),
@Result(column="wechat_open_id", property="wechatOpenId", jdbcType=JdbcType.VARCHAR),
@Result(column="wechat_unionid", property="wechatUnionid", jdbcType=JdbcType.VARCHAR),
@Result(column="elm_pid", property="elmPid", jdbcType=JdbcType.VARCHAR),
@Result(column="invite_user_id", property="inviteUserId", jdbcType=JdbcType.BIGINT), @Result(column="invite_user_id", property="inviteUserId", jdbcType=JdbcType.BIGINT),
@Result(column="invite_time", property="inviteTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="invite_time", property="inviteTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="partner_level", property="partnerLevel", jdbcType=JdbcType.INTEGER), @Result(column="partner_level", property="partnerLevel", jdbcType=JdbcType.INTEGER),
@ -84,9 +89,9 @@ public interface BsUserMapper extends BsUserMapperExt {
@Select({ @Select({
"select", "select",
"id, head_img, `name`, phone, grade, wechat_num, invite_user_id, invite_time, ", "id, head_img, `name`, phone, grade, wechat_num, wechat_open_id, wechat_unionid, ",
"partner_level, partner_income_per, `status`, create_time, update_time, ext_1, ", "elm_pid, invite_user_id, invite_time, partner_level, partner_income_per, `status`, ",
"ext_2, ext_3", "create_time, update_time, ext_1, ext_2, ext_3",
"from bs_user", "from bs_user",
"where id = #{id,jdbcType=BIGINT}" "where id = #{id,jdbcType=BIGINT}"
}) })
@ -97,6 +102,9 @@ public interface BsUserMapper extends BsUserMapperExt {
@Result(column="phone", property="phone", jdbcType=JdbcType.VARCHAR), @Result(column="phone", property="phone", jdbcType=JdbcType.VARCHAR),
@Result(column="grade", property="grade", jdbcType=JdbcType.INTEGER), @Result(column="grade", property="grade", jdbcType=JdbcType.INTEGER),
@Result(column="wechat_num", property="wechatNum", jdbcType=JdbcType.VARCHAR), @Result(column="wechat_num", property="wechatNum", jdbcType=JdbcType.VARCHAR),
@Result(column="wechat_open_id", property="wechatOpenId", jdbcType=JdbcType.VARCHAR),
@Result(column="wechat_unionid", property="wechatUnionid", jdbcType=JdbcType.VARCHAR),
@Result(column="elm_pid", property="elmPid", jdbcType=JdbcType.VARCHAR),
@Result(column="invite_user_id", property="inviteUserId", jdbcType=JdbcType.BIGINT), @Result(column="invite_user_id", property="inviteUserId", jdbcType=JdbcType.BIGINT),
@Result(column="invite_time", property="inviteTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="invite_time", property="inviteTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="partner_level", property="partnerLevel", jdbcType=JdbcType.INTEGER), @Result(column="partner_level", property="partnerLevel", jdbcType=JdbcType.INTEGER),
@ -126,6 +134,9 @@ public interface BsUserMapper extends BsUserMapperExt {
"phone = #{phone,jdbcType=VARCHAR},", "phone = #{phone,jdbcType=VARCHAR},",
"grade = #{grade,jdbcType=INTEGER},", "grade = #{grade,jdbcType=INTEGER},",
"wechat_num = #{wechatNum,jdbcType=VARCHAR},", "wechat_num = #{wechatNum,jdbcType=VARCHAR},",
"wechat_open_id = #{wechatOpenId,jdbcType=VARCHAR},",
"wechat_unionid = #{wechatUnionid,jdbcType=VARCHAR},",
"elm_pid = #{elmPid,jdbcType=VARCHAR},",
"invite_user_id = #{inviteUserId,jdbcType=BIGINT},", "invite_user_id = #{inviteUserId,jdbcType=BIGINT},",
"invite_time = #{inviteTime,jdbcType=TIMESTAMP},", "invite_time = #{inviteTime,jdbcType=TIMESTAMP},",
"partner_level = #{partnerLevel,jdbcType=INTEGER},", "partner_level = #{partnerLevel,jdbcType=INTEGER},",

@ -48,6 +48,18 @@ public class BsUserSqlProvider {
sql.VALUES("wechat_num", "#{wechatNum,jdbcType=VARCHAR}"); sql.VALUES("wechat_num", "#{wechatNum,jdbcType=VARCHAR}");
} }
if (record.getWechatOpenId() != null) {
sql.VALUES("wechat_open_id", "#{wechatOpenId,jdbcType=VARCHAR}");
}
if (record.getWechatUnionid() != null) {
sql.VALUES("wechat_unionid", "#{wechatUnionid,jdbcType=VARCHAR}");
}
if (record.getElmPid() != null) {
sql.VALUES("elm_pid", "#{elmPid,jdbcType=VARCHAR}");
}
if (record.getInviteUserId() != null) { if (record.getInviteUserId() != null) {
sql.VALUES("invite_user_id", "#{inviteUserId,jdbcType=BIGINT}"); sql.VALUES("invite_user_id", "#{inviteUserId,jdbcType=BIGINT}");
} }
@ -103,6 +115,9 @@ public class BsUserSqlProvider {
sql.SELECT("phone"); sql.SELECT("phone");
sql.SELECT("grade"); sql.SELECT("grade");
sql.SELECT("wechat_num"); sql.SELECT("wechat_num");
sql.SELECT("wechat_open_id");
sql.SELECT("wechat_unionid");
sql.SELECT("elm_pid");
sql.SELECT("invite_user_id"); sql.SELECT("invite_user_id");
sql.SELECT("invite_time"); sql.SELECT("invite_time");
sql.SELECT("partner_level"); sql.SELECT("partner_level");
@ -154,6 +169,18 @@ public class BsUserSqlProvider {
sql.SET("wechat_num = #{record.wechatNum,jdbcType=VARCHAR}"); sql.SET("wechat_num = #{record.wechatNum,jdbcType=VARCHAR}");
} }
if (record.getWechatOpenId() != null) {
sql.SET("wechat_open_id = #{record.wechatOpenId,jdbcType=VARCHAR}");
}
if (record.getWechatUnionid() != null) {
sql.SET("wechat_unionid = #{record.wechatUnionid,jdbcType=VARCHAR}");
}
if (record.getElmPid() != null) {
sql.SET("elm_pid = #{record.elmPid,jdbcType=VARCHAR}");
}
if (record.getInviteUserId() != null) { if (record.getInviteUserId() != null) {
sql.SET("invite_user_id = #{record.inviteUserId,jdbcType=BIGINT}"); sql.SET("invite_user_id = #{record.inviteUserId,jdbcType=BIGINT}");
} }
@ -208,6 +235,9 @@ public class BsUserSqlProvider {
sql.SET("phone = #{record.phone,jdbcType=VARCHAR}"); sql.SET("phone = #{record.phone,jdbcType=VARCHAR}");
sql.SET("grade = #{record.grade,jdbcType=INTEGER}"); sql.SET("grade = #{record.grade,jdbcType=INTEGER}");
sql.SET("wechat_num = #{record.wechatNum,jdbcType=VARCHAR}"); sql.SET("wechat_num = #{record.wechatNum,jdbcType=VARCHAR}");
sql.SET("wechat_open_id = #{record.wechatOpenId,jdbcType=VARCHAR}");
sql.SET("wechat_unionid = #{record.wechatUnionid,jdbcType=VARCHAR}");
sql.SET("elm_pid = #{record.elmPid,jdbcType=VARCHAR}");
sql.SET("invite_user_id = #{record.inviteUserId,jdbcType=BIGINT}"); sql.SET("invite_user_id = #{record.inviteUserId,jdbcType=BIGINT}");
sql.SET("invite_time = #{record.inviteTime,jdbcType=TIMESTAMP}"); sql.SET("invite_time = #{record.inviteTime,jdbcType=TIMESTAMP}");
sql.SET("partner_level = #{record.partnerLevel,jdbcType=INTEGER}"); sql.SET("partner_level = #{record.partnerLevel,jdbcType=INTEGER}");
@ -248,6 +278,18 @@ public class BsUserSqlProvider {
sql.SET("wechat_num = #{wechatNum,jdbcType=VARCHAR}"); sql.SET("wechat_num = #{wechatNum,jdbcType=VARCHAR}");
} }
if (record.getWechatOpenId() != null) {
sql.SET("wechat_open_id = #{wechatOpenId,jdbcType=VARCHAR}");
}
if (record.getWechatUnionid() != null) {
sql.SET("wechat_unionid = #{wechatUnionid,jdbcType=VARCHAR}");
}
if (record.getElmPid() != null) {
sql.SET("elm_pid = #{elmPid,jdbcType=VARCHAR}");
}
if (record.getInviteUserId() != null) { if (record.getInviteUserId() != null) {
sql.SET("invite_user_id = #{inviteUserId,jdbcType=BIGINT}"); sql.SET("invite_user_id = #{inviteUserId,jdbcType=BIGINT}");
} }

@ -44,6 +44,21 @@ public class BsUser implements Serializable {
*/ */
private String wechatNum; private String wechatNum;
/**
* 微信openid
*/
private String wechatOpenId;
/**
* 微信unionid
*/
private String wechatUnionid;
/**
* 饿了么推广位编码
*/
private String elmPid;
/** /**
* 邀请人id * 邀请人id
*/ */
@ -135,6 +150,30 @@ public class BsUser implements Serializable {
this.wechatNum = wechatNum; this.wechatNum = wechatNum;
} }
public String getWechatOpenId() {
return wechatOpenId;
}
public void setWechatOpenId(String wechatOpenId) {
this.wechatOpenId = wechatOpenId;
}
public String getWechatUnionid() {
return wechatUnionid;
}
public void setWechatUnionid(String wechatUnionid) {
this.wechatUnionid = wechatUnionid;
}
public String getElmPid() {
return elmPid;
}
public void setElmPid(String elmPid) {
this.elmPid = elmPid;
}
public Long getInviteUserId() { public Long getInviteUserId() {
return inviteUserId; return inviteUserId;
} }
@ -233,6 +272,9 @@ public class BsUser implements Serializable {
&& (this.getPhone() == null ? other.getPhone() == null : this.getPhone().equals(other.getPhone())) && (this.getPhone() == null ? other.getPhone() == null : this.getPhone().equals(other.getPhone()))
&& (this.getGrade() == null ? other.getGrade() == null : this.getGrade().equals(other.getGrade())) && (this.getGrade() == null ? other.getGrade() == null : this.getGrade().equals(other.getGrade()))
&& (this.getWechatNum() == null ? other.getWechatNum() == null : this.getWechatNum().equals(other.getWechatNum())) && (this.getWechatNum() == null ? other.getWechatNum() == null : this.getWechatNum().equals(other.getWechatNum()))
&& (this.getWechatOpenId() == null ? other.getWechatOpenId() == null : this.getWechatOpenId().equals(other.getWechatOpenId()))
&& (this.getWechatUnionid() == null ? other.getWechatUnionid() == null : this.getWechatUnionid().equals(other.getWechatUnionid()))
&& (this.getElmPid() == null ? other.getElmPid() == null : this.getElmPid().equals(other.getElmPid()))
&& (this.getInviteUserId() == null ? other.getInviteUserId() == null : this.getInviteUserId().equals(other.getInviteUserId())) && (this.getInviteUserId() == null ? other.getInviteUserId() == null : this.getInviteUserId().equals(other.getInviteUserId()))
&& (this.getInviteTime() == null ? other.getInviteTime() == null : this.getInviteTime().equals(other.getInviteTime())) && (this.getInviteTime() == null ? other.getInviteTime() == null : this.getInviteTime().equals(other.getInviteTime()))
&& (this.getPartnerLevel() == null ? other.getPartnerLevel() == null : this.getPartnerLevel().equals(other.getPartnerLevel())) && (this.getPartnerLevel() == null ? other.getPartnerLevel() == null : this.getPartnerLevel().equals(other.getPartnerLevel()))
@ -255,6 +297,9 @@ public class BsUser implements Serializable {
result = prime * result + ((getPhone() == null) ? 0 : getPhone().hashCode()); result = prime * result + ((getPhone() == null) ? 0 : getPhone().hashCode());
result = prime * result + ((getGrade() == null) ? 0 : getGrade().hashCode()); result = prime * result + ((getGrade() == null) ? 0 : getGrade().hashCode());
result = prime * result + ((getWechatNum() == null) ? 0 : getWechatNum().hashCode()); result = prime * result + ((getWechatNum() == null) ? 0 : getWechatNum().hashCode());
result = prime * result + ((getWechatOpenId() == null) ? 0 : getWechatOpenId().hashCode());
result = prime * result + ((getWechatUnionid() == null) ? 0 : getWechatUnionid().hashCode());
result = prime * result + ((getElmPid() == null) ? 0 : getElmPid().hashCode());
result = prime * result + ((getInviteUserId() == null) ? 0 : getInviteUserId().hashCode()); result = prime * result + ((getInviteUserId() == null) ? 0 : getInviteUserId().hashCode());
result = prime * result + ((getInviteTime() == null) ? 0 : getInviteTime().hashCode()); result = prime * result + ((getInviteTime() == null) ? 0 : getInviteTime().hashCode());
result = prime * result + ((getPartnerLevel() == null) ? 0 : getPartnerLevel().hashCode()); result = prime * result + ((getPartnerLevel() == null) ? 0 : getPartnerLevel().hashCode());
@ -280,6 +325,9 @@ public class BsUser implements Serializable {
sb.append(", phone=").append(phone); sb.append(", phone=").append(phone);
sb.append(", grade=").append(grade); sb.append(", grade=").append(grade);
sb.append(", wechatNum=").append(wechatNum); sb.append(", wechatNum=").append(wechatNum);
sb.append(", wechatOpenId=").append(wechatOpenId);
sb.append(", wechatUnionid=").append(wechatUnionid);
sb.append(", elmPid=").append(elmPid);
sb.append(", inviteUserId=").append(inviteUserId); sb.append(", inviteUserId=").append(inviteUserId);
sb.append(", inviteTime=").append(inviteTime); sb.append(", inviteTime=").append(inviteTime);
sb.append(", partnerLevel=").append(partnerLevel); sb.append(", partnerLevel=").append(partnerLevel);

@ -526,6 +526,216 @@ public class BsUserExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andWechatOpenIdIsNull() {
addCriterion("wechat_open_id is null");
return (Criteria) this;
}
public Criteria andWechatOpenIdIsNotNull() {
addCriterion("wechat_open_id is not null");
return (Criteria) this;
}
public Criteria andWechatOpenIdEqualTo(String value) {
addCriterion("wechat_open_id =", value, "wechatOpenId");
return (Criteria) this;
}
public Criteria andWechatOpenIdNotEqualTo(String value) {
addCriterion("wechat_open_id <>", value, "wechatOpenId");
return (Criteria) this;
}
public Criteria andWechatOpenIdGreaterThan(String value) {
addCriterion("wechat_open_id >", value, "wechatOpenId");
return (Criteria) this;
}
public Criteria andWechatOpenIdGreaterThanOrEqualTo(String value) {
addCriterion("wechat_open_id >=", value, "wechatOpenId");
return (Criteria) this;
}
public Criteria andWechatOpenIdLessThan(String value) {
addCriterion("wechat_open_id <", value, "wechatOpenId");
return (Criteria) this;
}
public Criteria andWechatOpenIdLessThanOrEqualTo(String value) {
addCriterion("wechat_open_id <=", value, "wechatOpenId");
return (Criteria) this;
}
public Criteria andWechatOpenIdLike(String value) {
addCriterion("wechat_open_id like", value, "wechatOpenId");
return (Criteria) this;
}
public Criteria andWechatOpenIdNotLike(String value) {
addCriterion("wechat_open_id not like", value, "wechatOpenId");
return (Criteria) this;
}
public Criteria andWechatOpenIdIn(List<String> values) {
addCriterion("wechat_open_id in", values, "wechatOpenId");
return (Criteria) this;
}
public Criteria andWechatOpenIdNotIn(List<String> values) {
addCriterion("wechat_open_id not in", values, "wechatOpenId");
return (Criteria) this;
}
public Criteria andWechatOpenIdBetween(String value1, String value2) {
addCriterion("wechat_open_id between", value1, value2, "wechatOpenId");
return (Criteria) this;
}
public Criteria andWechatOpenIdNotBetween(String value1, String value2) {
addCriterion("wechat_open_id not between", value1, value2, "wechatOpenId");
return (Criteria) this;
}
public Criteria andWechatUnionidIsNull() {
addCriterion("wechat_unionid is null");
return (Criteria) this;
}
public Criteria andWechatUnionidIsNotNull() {
addCriterion("wechat_unionid is not null");
return (Criteria) this;
}
public Criteria andWechatUnionidEqualTo(String value) {
addCriterion("wechat_unionid =", value, "wechatUnionid");
return (Criteria) this;
}
public Criteria andWechatUnionidNotEqualTo(String value) {
addCriterion("wechat_unionid <>", value, "wechatUnionid");
return (Criteria) this;
}
public Criteria andWechatUnionidGreaterThan(String value) {
addCriterion("wechat_unionid >", value, "wechatUnionid");
return (Criteria) this;
}
public Criteria andWechatUnionidGreaterThanOrEqualTo(String value) {
addCriterion("wechat_unionid >=", value, "wechatUnionid");
return (Criteria) this;
}
public Criteria andWechatUnionidLessThan(String value) {
addCriterion("wechat_unionid <", value, "wechatUnionid");
return (Criteria) this;
}
public Criteria andWechatUnionidLessThanOrEqualTo(String value) {
addCriterion("wechat_unionid <=", value, "wechatUnionid");
return (Criteria) this;
}
public Criteria andWechatUnionidLike(String value) {
addCriterion("wechat_unionid like", value, "wechatUnionid");
return (Criteria) this;
}
public Criteria andWechatUnionidNotLike(String value) {
addCriterion("wechat_unionid not like", value, "wechatUnionid");
return (Criteria) this;
}
public Criteria andWechatUnionidIn(List<String> values) {
addCriterion("wechat_unionid in", values, "wechatUnionid");
return (Criteria) this;
}
public Criteria andWechatUnionidNotIn(List<String> values) {
addCriterion("wechat_unionid not in", values, "wechatUnionid");
return (Criteria) this;
}
public Criteria andWechatUnionidBetween(String value1, String value2) {
addCriterion("wechat_unionid between", value1, value2, "wechatUnionid");
return (Criteria) this;
}
public Criteria andWechatUnionidNotBetween(String value1, String value2) {
addCriterion("wechat_unionid not between", value1, value2, "wechatUnionid");
return (Criteria) this;
}
public Criteria andElmPidIsNull() {
addCriterion("elm_pid is null");
return (Criteria) this;
}
public Criteria andElmPidIsNotNull() {
addCriterion("elm_pid is not null");
return (Criteria) this;
}
public Criteria andElmPidEqualTo(String value) {
addCriterion("elm_pid =", value, "elmPid");
return (Criteria) this;
}
public Criteria andElmPidNotEqualTo(String value) {
addCriterion("elm_pid <>", value, "elmPid");
return (Criteria) this;
}
public Criteria andElmPidGreaterThan(String value) {
addCriterion("elm_pid >", value, "elmPid");
return (Criteria) this;
}
public Criteria andElmPidGreaterThanOrEqualTo(String value) {
addCriterion("elm_pid >=", value, "elmPid");
return (Criteria) this;
}
public Criteria andElmPidLessThan(String value) {
addCriterion("elm_pid <", value, "elmPid");
return (Criteria) this;
}
public Criteria andElmPidLessThanOrEqualTo(String value) {
addCriterion("elm_pid <=", value, "elmPid");
return (Criteria) this;
}
public Criteria andElmPidLike(String value) {
addCriterion("elm_pid like", value, "elmPid");
return (Criteria) this;
}
public Criteria andElmPidNotLike(String value) {
addCriterion("elm_pid not like", value, "elmPid");
return (Criteria) this;
}
public Criteria andElmPidIn(List<String> values) {
addCriterion("elm_pid in", values, "elmPid");
return (Criteria) this;
}
public Criteria andElmPidNotIn(List<String> values) {
addCriterion("elm_pid not in", values, "elmPid");
return (Criteria) this;
}
public Criteria andElmPidBetween(String value1, String value2) {
addCriterion("elm_pid between", value1, value2, "elmPid");
return (Criteria) this;
}
public Criteria andElmPidNotBetween(String value1, String value2) {
addCriterion("elm_pid not between", value1, value2, "elmPid");
return (Criteria) this;
}
public Criteria andInviteUserIdIsNull() { public Criteria andInviteUserIdIsNull() {
addCriterion("invite_user_id is null"); addCriterion("invite_user_id is null");
return (Criteria) this; return (Criteria) this;

@ -589,7 +589,7 @@ public class PartnerServiceImpl implements PartnerService {
// 设置用户合伙人等级 // 设置用户合伙人等级
bsUser.setPartnerLevel(level.getLevel()); bsUser.setPartnerLevel(level.getLevel());
// 编辑用户数据 // 编辑用户数据
bsUserService.editData(bsUser); bsUserService.updateInfo(bsUser);
} }
// 收益记录 // 收益记录

@ -16,13 +16,13 @@ public interface BsUserGradeService {
* @param userId * @param userId
* @param userGrade * @param userGrade
*/ */
void gradeAdjust(Long userId, UserGradeEnum userGrade); void gradeAdjust(Long userId, UserGradeEnum userGrade) throws Exception;
/** /**
* 等级晋升 * 等级晋升
* @param userId * @param userId
*/ */
void promote(Long userId); void promote(Long userId) throws Exception;
/** /**
* 购买优淘会员 * 购买优淘会员

@ -72,18 +72,36 @@ public interface BsUserService {
BsUser getUser(Long userId); BsUser getUser(Long userId);
/** /**
* 查询详情SmsController * 查询详情
* @param userPhone * @param userPhone
* @return * @return
*/ */
BsUser getUser(String userPhone); BsUser getUser(String userPhone);
/**
* 查询详情
* @param wechatOpenId
* @return
*/
BsUser getUserByWechatOpenId(String wechatOpenId);
/** /**
* 查询列表 * 查询列表
* @param param * @param param
* @return * @return
*/ */
List<BsUser> getList(Map<String,Object> param); List<BsUser> getList(Map<String,Object> param);
/**
* 微信授权
* @param user 用户
* @param other 其他参数
* @param inviteUseId 邀请人id
* @return
* @throws Exception
*/
SessionObject weChatAuth(BsUser user, Map<String, Object> other, Long inviteUseId) throws Exception;
/** /**
* 用户注册 * 用户注册
* @param phone 手机号 * @param phone 手机号

@ -37,14 +37,14 @@ public class BsUserGradeServiceImpl implements BsUserGradeService {
@Override @Override
@Transactional(propagation= Propagation.REQUIRED,rollbackFor= {RuntimeException.class}) @Transactional(propagation= Propagation.REQUIRED,rollbackFor= {RuntimeException.class})
public void gradeAdjust(Long userId, UserGradeEnum userGrade) { public void gradeAdjust(Long userId, UserGradeEnum userGrade) throws Exception {
// 查询详情 // 查询详情
BsUser user = userService.getUser(userId); BsUser user = userService.getUser(userId);
if (user == null) { if (user == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, ""); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到用户");
} }
user.setGrade(userGrade.getCode()); user.setGrade(userGrade.getCode());
userService.editData(user); userService.updateInfo(user);
// 修改上下级关系等级 // 修改上下级关系等级
userParentRelService.updateParentGrade(user.getId(), userGrade); userParentRelService.updateParentGrade(user.getId(), userGrade);
@ -52,7 +52,7 @@ public class BsUserGradeServiceImpl implements BsUserGradeService {
@Override @Override
@Transactional(propagation= Propagation.REQUIRED,rollbackFor= {RuntimeException.class}) @Transactional(propagation= Propagation.REQUIRED,rollbackFor= {RuntimeException.class})
public void promote(Long userId) { public void promote(Long userId) throws Exception {
// 查询详情 // 查询详情
BsUser user = userService.getUser(userId); BsUser user = userService.getUser(userId);
if (user == null) { if (user == null) {
@ -62,7 +62,7 @@ public class BsUserGradeServiceImpl implements BsUserGradeService {
// 晋升优淘会员 // 晋升优淘会员
if (promoteGrade2(user)) { if (promoteGrade2(user)) {
user.setGrade(UserGradeEnum.grade2.getCode()); user.setGrade(UserGradeEnum.grade2.getCode());
userService.editData(user); userService.updateInfo(user);
// 修改上下级关系等级 // 修改上下级关系等级
userParentRelService.updateParentGrade(user.getId(), UserGradeEnum.grade2); userParentRelService.updateParentGrade(user.getId(), UserGradeEnum.grade2);
@ -71,7 +71,7 @@ public class BsUserGradeServiceImpl implements BsUserGradeService {
// 晋升团长 // 晋升团长
if (promoteGrade3(user)) { if (promoteGrade3(user)) {
user.setGrade(UserGradeEnum.grade3.getCode()); user.setGrade(UserGradeEnum.grade3.getCode());
userService.editData(user); userService.updateInfo(user);
// 修改上下级关系等级 // 修改上下级关系等级
userParentRelService.updateParentGrade(user.getId(), UserGradeEnum.grade3); userParentRelService.updateParentGrade(user.getId(), UserGradeEnum.grade3);
@ -80,7 +80,7 @@ public class BsUserGradeServiceImpl implements BsUserGradeService {
// 晋升渠道 // 晋升渠道
if (promoteGrade4(user)) { if (promoteGrade4(user)) {
user.setGrade(UserGradeEnum.grade4.getCode()); user.setGrade(UserGradeEnum.grade4.getCode());
userService.editData(user); userService.updateInfo(user);
// 修改上下级关系等级 // 修改上下级关系等级
userParentRelService.updateParentGrade(user.getId(), UserGradeEnum.grade4); userParentRelService.updateParentGrade(user.getId(), UserGradeEnum.grade4);

@ -92,13 +92,8 @@ public class BsUserServiceImpl implements BsUserService {
} }
String oldPhone = user.getPhone(); String oldPhone = user.getPhone();
user.setPhone(newPhone); user.setPhone(newPhone);
editData(user); updateInfo(user);
// 更新session
UserSessionObject session = new UserSessionObject();
session.setUser(user);
SessionObject sessionObject = new SessionObject(userToken(user.getId()), session);
userCenter.save(sessionObject);
// 删除缓存 // 删除缓存
redisUtil.hdel(CACHE_KEY, oldPhone); redisUtil.hdel(CACHE_KEY, oldPhone);
} }
@ -123,13 +118,7 @@ public class BsUserServiceImpl implements BsUserService {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到用户"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到用户");
} }
user.setWechatNum(wechatNum); user.setWechatNum(wechatNum);
editData(user); updateInfo(user);
// 更新session
UserSessionObject session = new UserSessionObject();
session.setUser(user);
SessionObject sessionObject = new SessionObject(userToken(user.getId()), session);
userCenter.save(sessionObject);
} }
@Override @Override
@ -145,21 +134,15 @@ public class BsUserServiceImpl implements BsUserService {
if (getUser(inviteUseId) == null) { if (getUser(inviteUseId) == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的邀请人Id"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的邀请人Id");
} }
user.setInviteUserId(inviteUseId);
user.setInviteTime(new Date());
editData(user);
BsUserParentRel userParentRel = new BsUserParentRel(); BsUserParentRel userParentRel = new BsUserParentRel();
userParentRel.setParentUserId(userParentRel.getParentUserId()); userParentRel.setParentUserId(userParentRel.getParentUserId());
userParentRel.setParentUserGrade(userParentRel.getParentUserGrade()); userParentRel.setParentUserGrade(userParentRel.getParentUserGrade());
userParentRel.setUserId(userId); userParentRel.setUserId(userId);
userParentRelService.editData(userParentRel); userParentRelService.editData(userParentRel);
// 更新session user.setInviteUserId(inviteUseId);
UserSessionObject session = new UserSessionObject(); user.setInviteTime(new Date());
session.setUser(user); updateInfo(user);
SessionObject sessionObject = new SessionObject(userToken(user.getId()), session);
userCenter.save(sessionObject);
} }
@Override @Override
@ -250,6 +233,17 @@ public class BsUserServiceImpl implements BsUserService {
return null; return null;
} }
@Override
public BsUser getUserByWechatOpenId(String wechatOpenId) {
BsUserExample example = new BsUserExample();
example.createCriteria().andStatusNotEqualTo(0).andWechatOpenIdEqualTo(wechatOpenId);
List<BsUser> list = userMapper.selectByExample(example);
if (!list.isEmpty()) {
return list.get(0);
}
return null;
}
@Override @Override
public List<BsUser> getList(Map<String, Object> param) { public List<BsUser> getList(Map<String, Object> param) {
BsUserExample example = new BsUserExample(); BsUserExample example = new BsUserExample();
@ -279,6 +273,49 @@ public class BsUserServiceImpl implements BsUserService {
return userMapper.selectByExample(example); return userMapper.selectByExample(example);
} }
@Override
@Transactional(propagation= Propagation.REQUIRED,rollbackFor= {RuntimeException.class})
public SessionObject weChatAuth(BsUser user, Map<String, Object> other, Long inviteUseId) throws Exception {
if (inviteUseId != null) {
// 校验邀请码
BsUserInviteCode userInviteCode = userInviteCodeService.getDetail(inviteUseId);
if (userInviteCode == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无效的邀请码");
}
user.setInviteUserId(userInviteCode.getUserId());
}
// 查询用户
BsUser bsUser = getUserByWechatOpenId(user.getWechatOpenId());
if (bsUser == null) {
bsUser = new BsUser();
bsUser.setHeadImg(user.getHeadImg());
bsUser.setName(user.getName());
bsUser.setWechatOpenId(user.getWechatOpenId());
bsUser.setWechatUnionid(user.getWechatUnionid());
bsUser.setGrade(UserGradeEnum.grade1.getCode());
bsUser.setStatus(UserStatusEnum.status1.getCode());
editData(user);
// 创建账户余额
userAccountService.create(user.getId());
} else {
bsUser.setHeadImg(user.getHeadImg());
bsUser.setName(user.getName());
user.setInviteUserId(inviteUseId);
user.setInviteTime(new Date());
updateInfo(user);
}
// 缓存
UserSessionObject session = new UserSessionObject();
session.setUser(user);
SessionObject sessionObject = new SessionObject(userToken(user.getId()), session);
userCenter.save(sessionObject);
// 异步记录登录信息
userLoginLogService.asyncCreateLog(UserLoginType.WECHAT_AUTH, user, (HttpServletRequest) RequestContextHolder.getRequestAttributes().resolveReference(RequestAttributes.REFERENCE_REQUEST));
return sessionObject;
}
@Override @Override
@Transactional(propagation= Propagation.REQUIRED,rollbackFor= {RuntimeException.class}) @Transactional(propagation= Propagation.REQUIRED,rollbackFor= {RuntimeException.class})
public BsUser register(String phone, Map<String, Object> other, Long inviteUseId) { public BsUser register(String phone, Map<String, Object> other, Long inviteUseId) {

@ -19,7 +19,7 @@ public enum UserLoginType {
/** /**
* 微信授权 * 微信授权
*/ */
WECHAT_EMPOWER("WECHAT_EMPOWER", "微信授权"), WECHAT_AUTH("WECHAT_AUTH", "微信授权"),
; ;
private String code; private String code;

Loading…
Cancel
Save