|
|
|
@ -67,7 +67,7 @@ public class PlatformTokenVerifier {
|
|
|
|
} catch (PlatformTokenException exception) {
|
|
|
|
} catch (PlatformTokenException exception) {
|
|
|
|
throw exception;
|
|
|
|
throw exception;
|
|
|
|
} catch (Exception exception) {
|
|
|
|
} catch (Exception exception) {
|
|
|
|
throw new PlatformTokenException("Invalid platform token", exception);
|
|
|
|
throw new PlatformTokenException("平台登录凭据无效", exception);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -85,5 +85,5 @@ public class PlatformTokenVerifier {
|
|
|
|
private long requiredLong(JsonNode payload, String name) { JsonNode node = payload.path(name); if (!node.canConvertToLong()) throw invalid(); return node.asLong(); }
|
|
|
|
private long requiredLong(JsonNode payload, String name) { JsonNode node = payload.path(name); if (!node.canConvertToLong()) throw invalid(); return node.asLong(); }
|
|
|
|
private String requiredText(JsonNode payload, String name) { String value = payload.path(name).asText(); if (value == null || value.trim().isEmpty()) throw invalid(); return value; }
|
|
|
|
private String requiredText(JsonNode payload, String name) { String value = payload.path(name).asText(); if (value == null || value.trim().isEmpty()) throw invalid(); return value; }
|
|
|
|
private String optionalText(JsonNode payload, String name) { JsonNode node = payload.path(name); return node.isMissingNode() || node.isNull() ? null : node.asText(); }
|
|
|
|
private String optionalText(JsonNode payload, String name) { JsonNode node = payload.path(name); return node.isMissingNode() || node.isNull() ? null : node.asText(); }
|
|
|
|
private PlatformTokenException invalid() { return new PlatformTokenException("Invalid platform token"); }
|
|
|
|
private PlatformTokenException invalid() { return new PlatformTokenException("平台登录凭据无效"); }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|