Skip to content

Commit 679a231

Browse files
committed
Merge branch 'master' into logical-foreign-keys
# Conflicts: # backend/app/admin/service/data_rule_service.py # backend/app/admin/service/dept_service.py # backend/common/security/permission.py # backend/plugin/oauth2/api/v1/user_social.py # backend/plugin/oauth2/crud/crud_user_social.py # backend/plugin/oauth2/service/user_social.py
2 parents c79e73b + 3160790 commit 679a231

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

backend/plugin/oauth2/api/v1/user_social.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
router = APIRouter()
1010

1111

12-
@router.delete('/me', summary='解绑社交账号', dependencies=[DependsJwtAuth])
13-
async def unbind_user(db: CurrentSessionTransaction, request: Request, source: UserSocialType) -> ResponseModel:
14-
await user_social_service.unbind(db=db, user_id=request.user.id, source=source)
12+
@router.delete('/me', summary='解绑用户社交账号', dependencies=[DependsJwtAuth])
13+
async def unbinding_user(db: CurrentSessionTransaction, request: Request, source: UserSocialType) -> ResponseModel:
14+
await user_social_service.unbinding(db=db, user_id=request.user.id, source=source)
1515
return response_base.success()

backend/plugin/oauth2/plugin.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[plugin]
22
summary = 'OAuth 2.0'
3-
version = '0.0.7'
3+
version = '0.0.8'
44
description = '通过 OAuth 2.0 的方式登录系统'
55
author = 'wu-clan'
66

backend/plugin/oauth2/service/user_social.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@
77

88
class UserSocialService:
99
@staticmethod
10-
async def unbind(*, db: AsyncSession, user_id: int, source: UserSocialType) -> int:
10+
async def unbinding(*, db: AsyncSession, user_id: int, source: UserSocialType) -> int:
1111
"""
12-
解绑用户社交
12+
解绑用户社交账号
1313
14-
:param db: 数据库绘画
14+
:param db: 数据库会话
1515
:param user_id: 用户 ID
1616
:param source: 解绑源
1717
:return:
1818
"""
1919
bind = user_social_dao.check_binding(db, user_id, source.value)
2020
if not bind:
21-
raise errors.NotFoundError(msg=f'用户未绑定 {source.value} 账户')
21+
raise errors.NotFoundError(msg=f'用户未绑定 {source.value} 账号')
2222
return await user_social_dao.delete(db, user_id, source.value)
2323

2424

0 commit comments

Comments
 (0)