Browse Source

fix 酷乐秀扫码登录

Eric 7 months ago
parent
commit
87d917a7ea

+ 1 - 0
cooleshow-app/src/main/java/com/yonge/cooleshow/config/ResourceServerConfig.java

@@ -38,6 +38,7 @@ public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
 						"/*/appVersionInfo/queryByPlatform",
 						"/*/uploadFile",
 						"/*/open/**",
+						"/open/**",
 						"/*/room/statusSync",
 						"/*/room/tencentRtcCallback",
 						"/*/wechat/*",

+ 2 - 15
cooleshow-auth/auth-server/src/main/java/com/yonge/cooleshow/auth/core/provider/PhoneAuthenticationProvider.java

@@ -28,6 +28,7 @@ import org.springframework.security.core.userdetails.UsernameNotFoundException;
 import org.springframework.security.jwt.Jwt;
 import org.springframework.security.jwt.JwtHelper;
 import org.springframework.security.jwt.crypto.sign.RsaVerifier;
+import org.springframework.security.oauth2.provider.OAuth2Authentication;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.security.interfaces.RSAPublicKey;
@@ -143,22 +144,8 @@ public class PhoneAuthenticationProvider extends AbstractAuthenticationProvider
 
             } else {
                 if (loginEntity.getClientId().toLowerCase().startsWith("qr_")) {
-                    // 授权authToken登录
-                    /*try {
-                        RSAPublicKey rsaPublicKey = RsaKeyHelper.getRSAPublicKey("jmedu", "dayaedu", "jmedu.jks", "dayaedu");
-                        Jwt jwt = JwtHelper.decodeAndVerify(smsCode, new RsaVerifier(rsaPublicKey));
-
-                        //获取jwt原始内容
-                        String claims = jwt.getClaims();
-                        if (StringUtils.isEmpty(claims)) {
-                            throw new BadCredentialsException("扫码登录授权校验失败");
-                        }
-                        log.info("SCAN_QRCODE_USER claims={}", claims);
-                    } catch (Exception e) {
-                        log.error("SCAN_QRCODE_USER code={}", smsCode, e);
-                    }*/
                     // 重置登录账号信息
-                    loginEntity.setClientId(loginEntity.getClientId().replace("qr_", "").toUpperCase());
+                    loginEntity.setClientId(loginEntity.getClientId().toLowerCase().replace("qr_", "").toUpperCase());
                 } else {
                     // 验证码验证
                     boolean b = smsCodeService.verifyValidCode(phone, smsCode, "SMS_VERIFY_CODE_LOGIN");