From b00cfa30a4f6a1c6d896d46da7dd063abf632cd3 Mon Sep 17 00:00:00 2001 From: 杨宇千 Date: Sat, 19 Oct 2019 21:37:15 +0800 Subject: ... --- Timeline/Services/JwtService.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Timeline/Services/JwtService.cs') diff --git a/Timeline/Services/JwtService.cs b/Timeline/Services/JwtService.cs index 350c5e80..90d0c217 100644 --- a/Timeline/Services/JwtService.cs +++ b/Timeline/Services/JwtService.cs @@ -33,6 +33,12 @@ namespace Timeline.Services public const int Expired = -2001; } + private const string message = "Jwt token is bad."; + + public JwtTokenVerifyException() : base(message) { } + public JwtTokenVerifyException(string message) : base(message) { } + public JwtTokenVerifyException(string message, Exception inner) : base(message, inner) { } + public JwtTokenVerifyException(int code) : base(GetErrorMessage(code)) { ErrorCode = code; } public JwtTokenVerifyException(string message, int code) : base(message) { ErrorCode = code; } public JwtTokenVerifyException(Exception inner, int code) : base(GetErrorMessage(code), inner) { ErrorCode = code; } @@ -41,7 +47,7 @@ namespace Timeline.Services System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { } - public int ErrorCode { get; private set; } + public int ErrorCode { get; set; } private static string GetErrorMessage(int errorCode) { -- cgit v1.2.3