Skip to content

Commit 6c93815

Browse files
committed
feat: 在主项目中添加新的error_code RefreshException
1 parent 5b4dc17 commit 6c93815

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

app/api/cms/user.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@
1111
create_refresh_token, verify_jwt_refresh_token_in_request
1212
from lin.core import manager, route_meta, Log
1313
from lin.db import db
14-
from lin.exception import NotFound, Success, Failed, RepeatException, ParameterException, RefreshException
14+
from lin.exception import NotFound, Success, Failed, RepeatException, ParameterException
1515
from lin.jwt import login_required, admin_required, get_tokens
1616
from lin.log import Logger
1717
from lin.redprint import Redprint
1818

19+
from app.libs.error_code import RefreshException
1920
from app.validators.forms import LoginForm, RegisterForm, ChangePasswordForm, UpdateInfoForm
2021

2122
user_api = Redprint('user')

app/libs/error_code.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,9 @@ class BookNotFound(APIException):
1010
code = 404 # http状态码
1111
msg = '没有找到相关图书' # 异常信息
1212
error_code = 80010 # 约定的异常码
13+
14+
15+
class RefreshException(APIException):
16+
code = 401
17+
msg = "refresh token 获取失败"
18+
error_code = 10100

0 commit comments

Comments
 (0)