org.apache.shiro.spring.boot.qrcode.endpoint.ShiroQrcodeEndpoint Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of shiro-qrcode-spring-boot-starter Show documentation
Show all versions of shiro-qrcode-spring-boot-starter Show documentation
Spring Boot Starter For Shiro With Qrcode
The newest version!
package org.apache.shiro.spring.boot.qrcode.endpoint;
import java.time.Duration;
import java.util.Map;
import java.util.UUID;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSONObject;
import com.beust.jcommander.internal.Maps;
import com.google.zxing.spring.boot.ZxingQrCodeTemplate;
@RestController("/authz/qrcode/")
public class ShiroQrcodeEndpoint {
private static final String STATUS_BOUND = "bound";
private static final String STATUS_UNBIND = "unbind";
private static final String STATUS_EXPIRED = "expired";
private final StringRedisTemplate stringRedisTemplate;
private final ZxingQrCodeTemplate qrcodeTemplate;
public ShiroQrcodeEndpoint(StringRedisTemplate stringRedisTemplate, ZxingQrCodeTemplate qrcodeTemplate) {
super();
this.stringRedisTemplate = stringRedisTemplate;
this.qrcodeTemplate = qrcodeTemplate;
}
/*
* 前端点击二维码登录时,访问该接口获取二维码数据并在界面展示
* @author : wandl
* @return
* @throws Exception
*/
@GetMapping("info")
@ResponseBody
public ResponseEntity
© 2015 - 2025 Weber Informatics LLC | Privacy Policy