|
@@ -62,6 +62,7 @@ class AuthService(@Qualifier("jwtSigningKey") val jwtSigningKey: Key, val authCo
|
|
/**
|
|
/**
|
|
* 对本服务签发的Ticket进行认证
|
|
* 对本服务签发的Ticket进行认证
|
|
*/
|
|
*/
|
|
|
|
+ @Suppress("UNCHECKED_CAST")
|
|
fun auth(form: AuthForm): AuthToken {
|
|
fun auth(form: AuthForm): AuthToken {
|
|
if (form.type.isNullOrEmpty() || !form.type.equals("qrcode", ignoreCase = true)) throw BusinessError(ERR_BUSINESS, "凭证类型不合法")
|
|
if (form.type.isNullOrEmpty() || !form.type.equals("qrcode", ignoreCase = true)) throw BusinessError(ERR_BUSINESS, "凭证类型不合法")
|
|
if (form.data.isNullOrEmpty()) throw BusinessError(ERR_BUSINESS, "凭证数据不合法")
|
|
if (form.data.isNullOrEmpty()) throw BusinessError(ERR_BUSINESS, "凭证数据不合法")
|
|
@@ -95,6 +96,7 @@ class AuthService(@Qualifier("jwtSigningKey") val jwtSigningKey: Key, val authCo
|
|
/**
|
|
/**
|
|
* 构建Ticket
|
|
* 构建Ticket
|
|
*/
|
|
*/
|
|
|
|
+ @Suppress("UNCHECKED_CAST")
|
|
fun createTicket(claims: Claims): String {
|
|
fun createTicket(claims: Claims): String {
|
|
return Jwts.builder()
|
|
return Jwts.builder()
|
|
.setSubject("qrscan")
|
|
.setSubject("qrscan")
|