saas:支持社交应用的多租户配置(wx 小程序)

This commit is contained in:
YunaiV
2023-10-19 21:42:39 +08:00
parent 6f757e5297
commit 979b484d7f
10 changed files with 168 additions and 33 deletions

View File

@ -1,6 +1,7 @@
package cn.iocoder.yudao.module.system.api.social;
import cn.iocoder.yudao.module.system.api.social.dto.SocialWxJsapiSignatureRespDTO;
import cn.iocoder.yudao.module.system.api.social.dto.SocialWxPhoneNumberInfoRespDTO;
import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum;
/**
@ -21,7 +22,7 @@ public interface SocialClientApi {
String getAuthorizeUrl(Integer type, Integer userType, String redirectUri);
/**
* 创建微信 JS SDK 初始化所需的签名
* 创建微信公众号 JS SDK 初始化所需的签名
*
* @param userType 用户类型
* @param url 访问的 URL 地址
@ -29,4 +30,13 @@ public interface SocialClientApi {
*/
SocialWxJsapiSignatureRespDTO createWxMpJsapiSignature(Integer userType, String url);
/**
* 获得微信小程序的手机信息
*
* @param userType 用户类型
* @param phoneCode 手机授权码
* @return 手机信息
*/
SocialWxPhoneNumberInfoRespDTO getWxMaPhoneNumberInfo(Integer userType, String phoneCode);
}

View File

@ -0,0 +1,27 @@
package cn.iocoder.yudao.module.system.api.social.dto;
import lombok.Data;
/**
* 微信小程序的手机信息 Response DTO
*
* @author 芋道源码
*/
@Data
public class SocialWxPhoneNumberInfoRespDTO {
/**
* 用户绑定的手机号(国外手机号会有区号)
*/
private String phoneNumber;
/**
* 没有区号的手机号
*/
private String purePhoneNumber;
/**
* 区号
*/
private String countryCode;
}

View File

@ -119,6 +119,8 @@ public interface ErrorCodeConstants {
ErrorCode SOCIAL_USER_UNBIND_NOT_SELF = new ErrorCode(1_002_018_001, "社交解绑失败,非当前用户绑定");
ErrorCode SOCIAL_USER_NOT_FOUND = new ErrorCode(1_002_018_002, "社交授权失败,找不到对应的用户");
ErrorCode SOCIAL_APP_WEIXIN_MINI_APP_PHONE_CODE_ERROR = new ErrorCode(1_002_018_103, "获得手机号失败");
// ========== 系统敏感词 1-002-019-000 =========
ErrorCode SENSITIVE_WORD_NOT_EXISTS = new ErrorCode(1_002_019_000, "系统敏感词在所有标签中都不存在");
ErrorCode SENSITIVE_WORD_EXISTS = new ErrorCode(1_002_019_001, "系统敏感词已在标签中存在");