justAuthRedisCacheTemplate,
+ JustAuthProperties justAuthProperties) {
+ return new RedisStateCache(justAuthRedisCacheTemplate, justAuthProperties.getCache());
+ }
+
+}
diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/justauth/core/AuthRequestFactory.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/justauth/core/AuthRequestFactory.java
new file mode 100644
index 0000000000..4ae8b78c6c
--- /dev/null
+++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/justauth/core/AuthRequestFactory.java
@@ -0,0 +1,321 @@
+/*
+ * Copyright (c) 2019-2029, xkcoding & Yangkai.Shen & 沈扬凯 (237497819@qq.com & xkcoding.com).
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0;
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package cn.iocoder.yudao.module.system.framework.justauth.core;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.EnumUtil;
+import cn.hutool.core.util.ReflectUtil;
+import cn.hutool.core.util.StrUtil;
+import com.xkcoding.http.config.HttpConfig;
+import com.xkcoding.justauth.autoconfigure.ExtendProperties;
+import com.xkcoding.justauth.autoconfigure.JustAuthProperties;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import me.zhyd.oauth.cache.AuthStateCache;
+import me.zhyd.oauth.config.AuthConfig;
+import me.zhyd.oauth.config.AuthDefaultSource;
+import me.zhyd.oauth.config.AuthSource;
+import me.zhyd.oauth.enums.AuthResponseStatus;
+import me.zhyd.oauth.exception.AuthException;
+import me.zhyd.oauth.request.*;
+import org.springframework.util.CollectionUtils;
+
+import java.net.InetSocketAddress;
+import java.net.Proxy;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+// TODO @芋艿:等官方发布 1.4.1!!!
+/**
+ *
+ * AuthRequest工厂类
+ *
+ *
+ * @author yangkai.shen
+ * @date Created in 2019-07-22 14:21
+ */
+@Slf4j
+@RequiredArgsConstructor
+public class AuthRequestFactory {
+ private final JustAuthProperties properties;
+ private final AuthStateCache authStateCache;
+
+ /**
+ * 返回当前Oauth列表
+ *
+ * @return Oauth列表
+ */
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ public List oauthList() {
+ // 默认列表
+ List defaultList = new ArrayList<>(properties.getType().keySet());
+ // 扩展列表
+ List extendList = new ArrayList<>();
+ ExtendProperties extend = properties.getExtend();
+ if (null != extend) {
+ Class enumClass = extend.getEnumClass();
+ List names = EnumUtil.getNames(enumClass);
+ // 扩展列表
+ extendList = extend.getConfig()
+ .keySet()
+ .stream()
+ .filter(x -> names.contains(x.toUpperCase()))
+ .map(String::toUpperCase)
+ .collect(Collectors.toList());
+ }
+
+ // 合并
+ return (List) CollUtil.addAll(defaultList, extendList);
+ }
+
+ /**
+ * 返回AuthRequest对象
+ *
+ * @param source {@link AuthSource}
+ * @return {@link AuthRequest}
+ */
+ public AuthRequest get(String source) {
+ if (StrUtil.isBlank(source)) {
+ throw new AuthException(AuthResponseStatus.NO_AUTH_SOURCE);
+ }
+
+ // 获取 JustAuth 中已存在的
+ AuthRequest authRequest = getDefaultRequest(source);
+
+ // 如果获取不到则尝试取自定义的
+ if (authRequest == null) {
+ authRequest = getExtendRequest(properties.getExtend().getEnumClass(), source);
+ }
+
+ if (authRequest == null) {
+ throw new AuthException(AuthResponseStatus.UNSUPPORTED);
+ }
+
+ return authRequest;
+ }
+
+ /**
+ * 获取自定义的 request
+ *
+ * @param clazz 枚举类 {@link AuthSource}
+ * @param source {@link AuthSource}
+ * @return {@link AuthRequest}
+ */
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ private AuthRequest getExtendRequest(Class clazz, String source) {
+ String upperSource = source.toUpperCase();
+ try {
+ EnumUtil.fromString(clazz, upperSource);
+ } catch (IllegalArgumentException e) {
+ // 无自定义匹配
+ return null;
+ }
+
+ Map extendConfig = properties.getExtend().getConfig();
+
+ // key 转大写
+ Map upperConfig = new HashMap<>(6);
+ extendConfig.forEach((k, v) -> upperConfig.put(k.toUpperCase(), v));
+
+ ExtendProperties.ExtendRequestConfig extendRequestConfig = upperConfig.get(upperSource);
+ if (extendRequestConfig != null) {
+
+ // 配置 http config
+ configureHttpConfig(upperSource, extendRequestConfig, properties.getHttpConfig());
+
+ Class extends AuthRequest> requestClass = extendRequestConfig.getRequestClass();
+
+ if (requestClass != null) {
+ // 反射获取 Request 对象,所以必须实现 2 个参数的构造方法
+ return ReflectUtil.newInstance(requestClass, (AuthConfig) extendRequestConfig, authStateCache);
+ }
+ }
+
+ return null;
+ }
+
+
+ /**
+ * 获取默认的 Request
+ *
+ * @param source {@link AuthSource}
+ * @return {@link AuthRequest}
+ */
+ private AuthRequest getDefaultRequest(String source) {
+ AuthDefaultSource authDefaultSource;
+
+ try {
+ authDefaultSource = EnumUtil.fromString(AuthDefaultSource.class, source.toUpperCase());
+ } catch (IllegalArgumentException e) {
+ // 无自定义匹配
+ return null;
+ }
+
+ AuthConfig config = properties.getType().get(authDefaultSource.name());
+ // 找不到对应关系,直接返回空
+ if (config == null) {
+ return null;
+ }
+
+ // 配置 http config
+ configureHttpConfig(authDefaultSource.name(), config, properties.getHttpConfig());
+
+ switch (authDefaultSource) {
+ case GITHUB:
+ return new AuthGithubRequest(config, authStateCache);
+ case WEIBO:
+ return new AuthWeiboRequest(config, authStateCache);
+ case GITEE:
+ return new AuthGiteeRequest(config, authStateCache);
+ case DINGTALK:
+ return new AuthDingTalkRequest(config, authStateCache);
+ case DINGTALK_V2:
+ return new AuthDingTalkV2Request(config, authStateCache);
+ case DINGTALK_ACCOUNT:
+ return new AuthDingTalkAccountRequest(config, authStateCache);
+ case BAIDU:
+ return new AuthBaiduRequest(config, authStateCache);
+ case CSDN:
+ return new AuthCsdnRequest(config, authStateCache);
+ case CODING:
+ return new AuthCodingRequest(config, authStateCache);
+ case OSCHINA:
+ return new AuthOschinaRequest(config, authStateCache);
+ case ALIPAY:
+ return new AuthAlipayRequest(config, authStateCache);
+ case QQ:
+ return new AuthQqRequest(config, authStateCache);
+ case WECHAT_OPEN:
+ return new AuthWeChatOpenRequest(config, authStateCache);
+ case WECHAT_MP:
+ return new AuthWeChatMpRequest(config, authStateCache);
+ case TAOBAO:
+ return new AuthTaobaoRequest(config, authStateCache);
+ case GOOGLE:
+ return new AuthGoogleRequest(config, authStateCache);
+ case FACEBOOK:
+ return new AuthFacebookRequest(config, authStateCache);
+ case DOUYIN:
+ return new AuthDouyinRequest(config, authStateCache);
+ case LINKEDIN:
+ return new AuthLinkedinRequest(config, authStateCache);
+ case MICROSOFT:
+ return new AuthMicrosoftRequest(config, authStateCache);
+ case MICROSOFT_CN:
+ return new AuthMicrosoftCnRequest(config, authStateCache);
+
+ case MI:
+ return new AuthMiRequest(config, authStateCache);
+ case TOUTIAO:
+ return new AuthToutiaoRequest(config, authStateCache);
+ case TEAMBITION:
+ return new AuthTeambitionRequest(config, authStateCache);
+ case RENREN:
+ return new AuthRenrenRequest(config, authStateCache);
+ case PINTEREST:
+ return new AuthPinterestRequest(config, authStateCache);
+ case STACK_OVERFLOW:
+ return new AuthStackOverflowRequest(config, authStateCache);
+ case HUAWEI:
+ return new AuthHuaweiRequest(config, authStateCache);
+ case HUAWEI_V3:
+ return new AuthHuaweiV3Request(config, authStateCache);
+ case WECHAT_ENTERPRISE:
+ return new AuthWeChatEnterpriseQrcodeRequest(config, authStateCache);
+ case WECHAT_ENTERPRISE_V2:
+ return new AuthWeChatEnterpriseQrcodeV2Request(config, authStateCache);
+ case WECHAT_ENTERPRISE_QRCODE_THIRD:
+ return new AuthWeChatEnterpriseThirdQrcodeRequest(config, authStateCache);
+ case WECHAT_ENTERPRISE_WEB:
+ return new AuthWeChatEnterpriseWebRequest(config, authStateCache);
+ case KUJIALE:
+ return new AuthKujialeRequest(config, authStateCache);
+ case GITLAB:
+ return new AuthGitlabRequest(config, authStateCache);
+ case MEITUAN:
+ return new AuthMeituanRequest(config, authStateCache);
+ case ELEME:
+ return new AuthElemeRequest(config, authStateCache);
+ case TWITTER:
+ return new AuthTwitterRequest(config, authStateCache);
+ case FEISHU:
+ return new AuthFeishuRequest(config, authStateCache);
+ case JD:
+ return new AuthJdRequest(config, authStateCache);
+ case ALIYUN:
+ return new AuthAliyunRequest(config, authStateCache);
+ case XMLY:
+ return new AuthXmlyRequest(config, authStateCache);
+ case AMAZON:
+ return new AuthAmazonRequest(config, authStateCache);
+ case SLACK:
+ return new AuthSlackRequest(config, authStateCache);
+ case LINE:
+ return new AuthLineRequest(config, authStateCache);
+ case OKTA:
+ return new AuthOktaRequest(config, authStateCache);
+ case PROGINN:
+ return new AuthProginnRequest(config,authStateCache);
+ case AFDIAN:
+ return new AuthAfDianRequest(config,authStateCache);
+ case APPLE:
+ return new AuthAppleRequest(config,authStateCache);
+ case FIGMA:
+ return new AuthFigmaRequest(config,authStateCache);
+ case WECHAT_MINI_PROGRAM:
+ config.setIgnoreCheckRedirectUri(true);
+ config.setIgnoreCheckState(true);
+ return new AuthWechatMiniProgramRequest(config, authStateCache);
+ case QQ_MINI_PROGRAM:
+ config.setIgnoreCheckRedirectUri(true);
+ config.setIgnoreCheckState(true);
+ return new AuthQQMiniProgramRequest(config, authStateCache);
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * 配置 http 相关的配置
+ *
+ * @param authSource {@link AuthSource}
+ * @param authConfig {@link AuthConfig}
+ */
+ private void configureHttpConfig(String authSource, AuthConfig authConfig, JustAuthProperties.JustAuthHttpConfig httpConfig) {
+ if (null == httpConfig) {
+ return;
+ }
+ Map proxyConfigMap = httpConfig.getProxy();
+ if (CollectionUtils.isEmpty(proxyConfigMap)) {
+ return;
+ }
+ JustAuthProperties.JustAuthProxyConfig proxyConfig = proxyConfigMap.get(authSource);
+
+ if (null == proxyConfig) {
+ return;
+ }
+
+ authConfig.setHttpConfig(HttpConfig.builder()
+ .timeout(httpConfig.getTimeout())
+ .proxy(new Proxy(Proxy.Type.valueOf(proxyConfig.getType()), new InetSocketAddress(proxyConfig.getHostname(), proxyConfig.getPort())))
+ .build());
+ }
+}
\ No newline at end of file
diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/justauth/package-info.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/justauth/package-info.java
new file mode 100644
index 0000000000..e9af3ab18a
--- /dev/null
+++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/justauth/package-info.java
@@ -0,0 +1,6 @@
+/**
+ * justauth 三方登录的拓展
+ *
+ * @author 芋道源码
+ */
+package cn.iocoder.yudao.module.system.framework.justauth;
\ No newline at end of file
diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialClientService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialClientService.java
index 5b293c41c9..40578a6cd0 100644
--- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialClientService.java
+++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialClientService.java
@@ -8,10 +8,10 @@ import cn.iocoder.yudao.module.system.controller.admin.socail.vo.client.SocialCl
import cn.iocoder.yudao.module.system.controller.admin.socail.vo.client.SocialClientSaveReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.social.SocialClientDO;
import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum;
-import com.xingyuv.jushauth.model.AuthUser;
import jakarta.validation.Valid;
import me.chanjar.weixin.common.bean.WxJsapiSignature;
import me.chanjar.weixin.common.bean.subscribemsg.TemplateInfo;
+import me.zhyd.oauth.model.AuthUser;
import java.util.List;
diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialClientServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialClientServiceImpl.java
index 7095193efb..4d5d13ca27 100644
--- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialClientServiceImpl.java
+++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialClientServiceImpl.java
@@ -26,18 +26,12 @@ import cn.iocoder.yudao.module.system.dal.dataobject.social.SocialClientDO;
import cn.iocoder.yudao.module.system.dal.mysql.social.SocialClientMapper;
import cn.iocoder.yudao.module.system.dal.redis.RedisKeyConstants;
import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum;
+import cn.iocoder.yudao.module.system.framework.justauth.core.AuthRequestFactory;
import com.binarywang.spring.starter.wxjava.miniapp.properties.WxMaProperties;
import com.binarywang.spring.starter.wxjava.mp.properties.WxMpProperties;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
-import com.xingyuv.jushauth.config.AuthConfig;
-import com.xingyuv.jushauth.model.AuthCallback;
-import com.xingyuv.jushauth.model.AuthResponse;
-import com.xingyuv.jushauth.model.AuthUser;
-import com.xingyuv.jushauth.request.AuthRequest;
-import com.xingyuv.jushauth.utils.AuthStateUtils;
-import com.xingyuv.justauth.AuthRequestFactory;
import jakarta.annotation.Resource;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
@@ -48,6 +42,12 @@ import me.chanjar.weixin.common.redis.RedisTemplateWxRedisOps;
import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl;
import me.chanjar.weixin.mp.config.impl.WxMpRedisConfigImpl;
+import me.zhyd.oauth.config.AuthConfig;
+import me.zhyd.oauth.model.AuthCallback;
+import me.zhyd.oauth.model.AuthResponse;
+import me.zhyd.oauth.model.AuthUser;
+import me.zhyd.oauth.request.AuthRequest;
+import me.zhyd.oauth.utils.AuthStateUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.redis.core.StringRedisTemplate;
@@ -337,7 +337,7 @@ public class SocialClientServiceImpl implements SocialClientService {
WxMaService getWxMaService(Integer userType) {
// 第一步,查询 DB 的配置项,获得对应的 WxMaService 对象
SocialClientDO client = socialClientMapper.selectBySocialTypeAndUserType(
- SocialTypeEnum.WECHAT_MINI_APP.getType(), userType);
+ SocialTypeEnum.WECHAT_MINI_PROGRAM.getType(), userType);
if (client != null && Objects.equals(client.getStatus(), CommonStatusEnum.ENABLE.getStatus())) {
return wxMaServiceCache.getUnchecked(client.getClientId() + ":" + client.getClientSecret());
}
diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialUserServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialUserServiceImpl.java
index dedab0db3a..f3cad58ebd 100644
--- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialUserServiceImpl.java
+++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialUserServiceImpl.java
@@ -6,21 +6,20 @@ import cn.iocoder.yudao.framework.common.exception.ServiceException;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.system.api.social.dto.SocialUserBindReqDTO;
import cn.iocoder.yudao.module.system.api.social.dto.SocialUserRespDTO;
-import cn.iocoder.yudao.module.system.api.social.dto.SocialWxQrcodeReqDTO;
import cn.iocoder.yudao.module.system.controller.admin.socail.vo.user.SocialUserPageReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.social.SocialUserBindDO;
import cn.iocoder.yudao.module.system.dal.dataobject.social.SocialUserDO;
import cn.iocoder.yudao.module.system.dal.mysql.social.SocialUserBindMapper;
import cn.iocoder.yudao.module.system.dal.mysql.social.SocialUserMapper;
import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum;
-import com.xingyuv.jushauth.model.AuthUser;
+import jakarta.annotation.Resource;
+import jakarta.validation.constraints.NotNull;
import lombok.extern.slf4j.Slf4j;
+import me.zhyd.oauth.model.AuthUser;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
-import jakarta.annotation.Resource;
-import jakarta.validation.constraints.NotNull;
import java.util.Collections;
import java.util.List;
diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/social/SocialClientServiceImplTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/social/SocialClientServiceImplTest.java
index fba8ff07e6..02f7a6155f 100644
--- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/social/SocialClientServiceImplTest.java
+++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/social/SocialClientServiceImplTest.java
@@ -13,26 +13,25 @@ import cn.iocoder.yudao.module.system.controller.admin.socail.vo.client.SocialCl
import cn.iocoder.yudao.module.system.dal.dataobject.social.SocialClientDO;
import cn.iocoder.yudao.module.system.dal.mysql.social.SocialClientMapper;
import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum;
+import cn.iocoder.yudao.module.system.framework.justauth.core.AuthRequestFactory;
import com.binarywang.spring.starter.wxjava.miniapp.properties.WxMaProperties;
import com.binarywang.spring.starter.wxjava.mp.properties.WxMpProperties;
-import com.xingyuv.jushauth.config.AuthConfig;
-import com.xingyuv.jushauth.model.AuthResponse;
-import com.xingyuv.jushauth.model.AuthUser;
-import com.xingyuv.jushauth.request.AuthDefaultRequest;
-import com.xingyuv.jushauth.request.AuthRequest;
-import com.xingyuv.jushauth.utils.AuthStateUtils;
-import com.xingyuv.justauth.AuthRequestFactory;
+import jakarta.annotation.Resource;
import me.chanjar.weixin.common.bean.WxJsapiSignature;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.mp.api.WxMpService;
+import me.zhyd.oauth.config.AuthConfig;
+import me.zhyd.oauth.model.AuthResponse;
+import me.zhyd.oauth.model.AuthUser;
+import me.zhyd.oauth.request.AuthDefaultRequest;
+import me.zhyd.oauth.request.AuthRequest;
+import me.zhyd.oauth.utils.AuthStateUtils;
import org.junit.jupiter.api.Test;
import org.mockito.MockedStatic;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.context.annotation.Import;
import org.springframework.data.redis.core.StringRedisTemplate;
-import jakarta.annotation.Resource;
-
import static cn.hutool.core.util.RandomUtil.randomEle;
import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId;
import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals;
@@ -103,7 +102,7 @@ public class SocialClientServiceImplTest extends BaseDbUnitTest {
when(authRequestFactory.get(eq("WECHAT_MP"))).thenReturn(authRequest);
// mock 方法(AuthResponse)
AuthUser authUser = randomPojo(AuthUser.class);
- AuthResponse> authResponse = new AuthResponse<>(2000, null, authUser);
+ AuthResponse authResponse = new AuthResponse<>(2000, null, authUser);
when(authRequest.login(argThat(authCallback -> {
assertEquals(code, authCallback.getCode());
assertEquals(state, authCallback.getState());
@@ -127,7 +126,7 @@ public class SocialClientServiceImplTest extends BaseDbUnitTest {
AuthRequest authRequest = mock(AuthRequest.class);
when(authRequestFactory.get(eq("WECHAT_MP"))).thenReturn(authRequest);
// mock 方法(AuthResponse)
- AuthResponse> authResponse = new AuthResponse<>(0, "模拟失败", null);
+ AuthResponse authResponse = new AuthResponse<>(0, "模拟失败", null);
when(authRequest.login(argThat(authCallback -> {
assertEquals(code, authCallback.getCode());
assertEquals(state, authCallback.getState());
@@ -317,7 +316,7 @@ public class SocialClientServiceImplTest extends BaseDbUnitTest {
Integer userType = randomPojo(UserTypeEnum.class).getValue();
// mock 数据
SocialClientDO client = randomPojo(SocialClientDO.class, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus())
- .setUserType(userType).setSocialType(SocialTypeEnum.WECHAT_MINI_APP.getType()));
+ .setUserType(userType).setSocialType(SocialTypeEnum.WECHAT_MINI_PROGRAM.getType()));
socialClientMapper.insert(client);
// 调用
@@ -332,7 +331,7 @@ public class SocialClientServiceImplTest extends BaseDbUnitTest {
Integer userType = randomPojo(UserTypeEnum.class).getValue();
// mock 数据
SocialClientDO client = randomPojo(SocialClientDO.class, o -> o.setStatus(CommonStatusEnum.ENABLE.getStatus())
- .setUserType(userType).setSocialType(SocialTypeEnum.WECHAT_MINI_APP.getType()));
+ .setUserType(userType).setSocialType(SocialTypeEnum.WECHAT_MINI_PROGRAM.getType()));
socialClientMapper.insert(client);
// mock 方法
WxMaProperties.ConfigStorage configStorage = mock(WxMaProperties.ConfigStorage.class);
diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/social/SocialUserServiceImplTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/social/SocialUserServiceImplTest.java
index 32393dd51c..84164155e5 100644
--- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/social/SocialUserServiceImplTest.java
+++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/social/SocialUserServiceImplTest.java
@@ -11,12 +11,12 @@ import cn.iocoder.yudao.module.system.dal.dataobject.social.SocialUserDO;
import cn.iocoder.yudao.module.system.dal.mysql.social.SocialUserBindMapper;
import cn.iocoder.yudao.module.system.dal.mysql.social.SocialUserMapper;
import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum;
-import com.xingyuv.jushauth.model.AuthUser;
+import jakarta.annotation.Resource;
+import me.zhyd.oauth.model.AuthUser;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.context.annotation.Import;
-import jakarta.annotation.Resource;
import java.util.List;
import static cn.hutool.core.util.RandomUtil.randomEle;
diff --git a/yudao-server/src/main/resources/application-dev.yaml b/yudao-server/src/main/resources/application-dev.yaml
index 7ca9ec6cc1..db07245c63 100644
--- a/yudao-server/src/main/resources/application-dev.yaml
+++ b/yudao-server/src/main/resources/application-dev.yaml
@@ -186,7 +186,7 @@ justauth:
agent-id: 1000004
ignore-check-redirect-uri: true
# noinspection SpringBootApplicationYaml
- WECHAT_MINI_APP: # 微信小程序
+ WECHAT_MINI_PROGRAM: # 微信小程序
client-id: ${wx.miniapp.appid}
client-secret: ${wx.miniapp.secret}
ignore-check-redirect-uri: true
diff --git a/yudao-server/src/main/resources/application-local.yaml b/yudao-server/src/main/resources/application-local.yaml
index 77438ef2af..bcb2236261 100644
--- a/yudao-server/src/main/resources/application-local.yaml
+++ b/yudao-server/src/main/resources/application-local.yaml
@@ -209,10 +209,10 @@ wx:
# secret: 333ae72f41552af1e998fe1f54e1584a
# appid: wx63c280fe3248a3e7 # wenhualian的接口测试号
# secret: 6f270509224a7ae1296bbf1c8cb97aed
-# appid: wxc4598c446f8a9cb3 # 测试号(Kongdy 提供的)
-# secret: 4a1a04e07f6a4a0751b39c3064a92c8b
- appid: wx66186af0759f47c9 # 测试号(puhui 提供的)
- secret: 3218bcbd112cbc614c7264ceb20144ac
+ appid: wxc4598c446f8a9cb3 # 测试号(Kongdy 提供的)
+ secret: 4a1a04e07f6a4a0751b39c3064a92c8b
+# appid: wx66186af0759f47c9 # 测试号(puhui 提供的)
+# secret: 3218bcbd112cbc614c7264ceb20144ac
config-storage:
type: RedisTemplate # 采用 RedisTemplate 操作 Redis,会自动从 Spring 中获取
key-prefix: wa # Redis Key 的前缀
@@ -252,7 +252,7 @@ justauth:
agent-id: 1000004
ignore-check-redirect-uri: true
# noinspection SpringBootApplicationYaml
- WECHAT_MINI_APP: # 微信小程序
+ WECHAT_MINI_PROGRAM: # 微信小程序
client-id: ${wx.miniapp.appid}
client-secret: ${wx.miniapp.secret}
ignore-check-redirect-uri: true