mirror of
https://gitee.com/likeadmin/likeadmin_java.git
synced 2026-05-31 22:19:35 +08:00
feat 同步流媒体
feat 优化sql feat 增加网页授权登录的接口
This commit is contained in:
@@ -108,7 +108,7 @@ public class LoginController {
|
||||
|
||||
|
||||
@NotLogin
|
||||
@GetMapping("/scanCodeUrl")
|
||||
@GetMapping("/getScanCode")
|
||||
@ApiOperation(value="PC扫码链接")
|
||||
public AjaxResult<LoginUrlsVo> scanCodeUrl(@Validated @NotNull() @RequestParam("url") String url, HttpSession session) {
|
||||
String qrcodeUrl = iLoginService.scanCodeUrl(url, session);
|
||||
|
||||
@@ -243,7 +243,7 @@ public class LoginServiceImpl implements ILoginService {
|
||||
@Override
|
||||
public String scanCodeUrl(String url, HttpSession session) {
|
||||
// 获取AppId
|
||||
String appId = ConfigUtils.get("op_channel", "appId", "");
|
||||
String appId = ConfigUtils.get("oa_setting", "app_id", "");
|
||||
|
||||
// 微信开放平台授权
|
||||
String baseUrl = "https://open.weixin.qq.com/connect/qrconnect" +
|
||||
@@ -265,7 +265,11 @@ public class LoginServiceImpl implements ILoginService {
|
||||
// 防止csrf攻击
|
||||
String state = ToolUtils.makeUUID().replaceAll("-", "");
|
||||
ScanLoginCache.set(session.getId(), state);
|
||||
|
||||
System.out.println(baseUrl);
|
||||
System.out.println(appId);
|
||||
System.out.println(redirectUrl);
|
||||
System.out.println(state);
|
||||
System.out.println(String.format(baseUrl, appId, redirectUrl, state));
|
||||
//生成QrcodeUrl
|
||||
return String.format(baseUrl, appId, redirectUrl, state);
|
||||
}
|
||||
@@ -286,8 +290,8 @@ public class LoginServiceImpl implements ILoginService {
|
||||
}
|
||||
|
||||
// 得到配置和授权临时票据code
|
||||
String appId = ConfigUtils.get("op_channel", "appId", "");
|
||||
String appSecret = ConfigUtils.get("op_channel", "appSecret", "");
|
||||
String appId = ConfigUtils.get("oa_setting", "app_id", "");
|
||||
String appSecret = ConfigUtils.get("oa_setting", "app_secret", "");
|
||||
|
||||
//向认证服务器发送请求换取access_token
|
||||
String baseAccessTokenUrl = "https://api.weixin.qq.com/sns/oauth2/access_token" +
|
||||
|
||||
Reference in New Issue
Block a user