修复: 扫码登录state检测

This commit is contained in:
TinyAnts 2023-03-14 14:59:30 +08:00
parent a636a36884
commit da29c32357
1 changed files with 4 additions and 0 deletions

View File

@ -241,6 +241,10 @@ public class LoginServiceImpl implements ILoginService {
*/
@Override
public LoginTokenVo scanLogin(String code, String state, Integer terminal, HttpSession session) {
if (!ScanLoginCache.get(session.getId()).equals(state)) {
throw new OperateException("二维码已失效或不存在,请重新操作");
}
// 得到配置和授权临时票据code
String appId = ConfigUtils.get("op_channel", "appId", "");
String appSecret = ConfigUtils.get("op_channel", "appSecret", "");