商家注册增加邀请码可选参数
This commit is contained in:
parent
a7f2d2a02c
commit
33c04e83e8
@ -208,7 +208,7 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
||||
data.put("key", token);
|
||||
data.put("rid", rid); // 用户角色 rid:0-用户;2-商家;3-门店;9-平台;
|
||||
|
||||
//user_type 用户类型,对应user_base 的 is_admin:0-普通用户;1-管理员;2-入驻商家;
|
||||
//user_type 用户类型,对应user_base 的 user_is_admin:0-普通用户;1-管理员;2-入驻商家;3-代理商;
|
||||
String as = bindConnectService.getBind(user_id, BindCode.MOBILE, userDto.getUserType()) == null ? "0" : "1";
|
||||
data.put("as", as); // 是否绑定了手机号 0-否 1-是
|
||||
CookieUtils.setCookie("as", as);
|
||||
@ -255,7 +255,7 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
||||
public Map<String, Object> getUserInfo(Integer user_id) {
|
||||
QueryWrapper<AccountUserBase> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("user_id", user_id).select(AccountUserBase.class, info -> !info.getColumn().equals("user_password"));
|
||||
AccountUserBase accountUserBase = getOne(queryWrapper);
|
||||
AccountUserBase accountUserBase = getOne(queryWrapper, false);
|
||||
setIdentityByUser(accountUserBase);
|
||||
|
||||
AccountUserInfo userInfo = accountUserInfoService.get(user_id);
|
||||
@ -296,6 +296,16 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
||||
adminMap.put("user_level_rate", baseUserLevel.getUser_level_rate());
|
||||
}
|
||||
|
||||
String inviteCode = "";
|
||||
if (CommonConstant.USER_TYPE_AGENT.equals(accountUserBase.getUser_is_admin())) {
|
||||
AccountUserBindConnect bindConnect = accountUserBindConnectService.getBindByUserId(user_id, BindCode.MOBILE, CommonConstant.USER_TYPE_MCH);
|
||||
if (bindConnect != null && StrUtil.isNotBlank(bindConnect.getInvite_code())) {
|
||||
inviteCode = bindConnect.getInvite_code();
|
||||
}
|
||||
}
|
||||
// 代理商邀请码
|
||||
adminMap.put("invite_code", inviteCode);
|
||||
|
||||
return adminMap;
|
||||
}
|
||||
|
||||
|
||||
@ -30,6 +30,11 @@ public class AuthConstant {
|
||||
*/
|
||||
public static final String MCH_CLIENT_ID = "mch-app";
|
||||
|
||||
/**
|
||||
* 商家版移动端client_id
|
||||
*/
|
||||
public static final String AGENT_CLIENT_ID = "agent-app";
|
||||
|
||||
/**
|
||||
* 微信client_ID
|
||||
*/
|
||||
|
||||
@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.suisung.mall.common.constant.AuthConstant;
|
||||
import com.suisung.mall.common.constant.CommonConstant;
|
||||
import com.suisung.mall.common.utils.CheckUtil;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
@ -23,7 +24,7 @@ public class UserDto implements Serializable {
|
||||
private String user_password;
|
||||
private String user_nickname;
|
||||
private Integer user_state;
|
||||
private String client_id; // 客户端 :后台管理-admin-app,移动端-mobile-app,入驻商家移动端-mch-app
|
||||
private String client_id; // 客户端 :后台管理-admin-app,移动端-mobile-app,入驻商家移动端-mch-app,代理商端-agent-app
|
||||
private String user_salt;
|
||||
private List<String> roles;
|
||||
// 服务端返回rid 角色编号: 0-用户;2-商家;3-门店;9-平台;
|
||||
@ -31,6 +32,8 @@ public class UserDto implements Serializable {
|
||||
private Integer site_id = 0; //分站编号
|
||||
private String store_id;
|
||||
private String chain_id;
|
||||
private Integer user_is_admin;//用户类型:对应user_base 的 is_admin:0-普通用户;1-管理员;2-入驻商家;3-代理商;
|
||||
private String invite_code; // 代理商邀请码
|
||||
|
||||
/**
|
||||
* 用户角色是平台
|
||||
@ -91,18 +94,41 @@ public class UserDto implements Serializable {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户类型:对应user_base 的 is_admin:0-普通用户;1-管理员;2-入驻商家;
|
||||
* 代理商端
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isAgent() {
|
||||
return ObjectUtil.equal(client_id, AuthConstant.AGENT_CLIENT_ID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户类型:对应user_base 的 user_is_admin:0-普通用户;1-管理员;2-入驻商家;3-代理商;
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
// public Integer getUserType() {
|
||||
// Integer user_type = CommonConstant.USER_TYPE_NORMAL; // 用户类型,对应user_base 的 user_is_admin:0-普通用户;1-管理员;2-入驻商家;3-代理商;
|
||||
// if (isAdmin()) {
|
||||
// user_type = CommonConstant.USER_TYPE_ADMIN;
|
||||
// } else if (isMerchant()) {
|
||||
// user_type = CommonConstant.USER_TYPE_MCH;
|
||||
// } else if (isAgent()) {
|
||||
// user_type = CommonConstant.USER_TYPE_AGENT;
|
||||
// } else {
|
||||
// user_type = CommonConstant.USER_TYPE_NORMAL;
|
||||
// }
|
||||
//
|
||||
// return user_type;
|
||||
// }
|
||||
|
||||
/**
|
||||
* 获取用户类型:对应user_base 的 user_is_admin:0-普通用户;1-管理员;2-入驻商家;3-代理商;
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Integer getUserType() {
|
||||
Integer user_type = CommonConstant.USER_TYPE_NORMAL; // 用户类型,对应user_base 的 is_admin:0-普通用户;1-管理员;2-入驻商家;
|
||||
if (isAdmin()) {
|
||||
user_type = CommonConstant.USER_TYPE_ADMIN;
|
||||
} else if (isMerchant()) {
|
||||
user_type = CommonConstant.USER_TYPE_MCH;
|
||||
}
|
||||
|
||||
return user_type;
|
||||
// 用户类型,对应user_base 的 is_admin:0-普通用户;1-管理员;2-入驻商家;
|
||||
return CheckUtil.isNotEmpty(this.user_is_admin) ? this.user_is_admin : CommonConstant.USER_TYPE_NORMAL;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user