feat: GEO/SEO structured data + search ranking tracker
This commit is contained in:
@@ -78,6 +78,8 @@ def update_user(
|
||||
user = db.query(User).filter(User.id == user_id).first()
|
||||
if not user:
|
||||
raise HTTPException(status_code=404, detail="用户不存在")
|
||||
if admin_user.role != "admin" and user.org_id != admin_user.org_id:
|
||||
raise HTTPException(status_code=404, detail="用户不存在")
|
||||
|
||||
changes = {}
|
||||
if user_update.username is not None:
|
||||
@@ -122,6 +124,8 @@ def delete_user(
|
||||
user = db.query(User).filter(User.id == user_id).first()
|
||||
if not user:
|
||||
raise HTTPException(status_code=404, detail="用户不存在")
|
||||
if admin_user.role != "admin" and user.org_id != admin_user.org_id:
|
||||
raise HTTPException(status_code=404, detail="用户不存在")
|
||||
|
||||
if user.role == "admin":
|
||||
raise HTTPException(status_code=400, detail="不能删除管理员用户")
|
||||
|
||||
Reference in New Issue
Block a user