上线版: 产品表单统一+form嵌套修复+用户管理+部署+三套叙事
- 产品编辑入口统一走 ProductFormFull(卖点/风格/人群/品牌词全字段); 修复开任务页 <form> 套 <form> 致"编辑产品"报错、改不了、跳回首个产品 - dashboard 入口卡片对齐实际路由: 系统管理(/config) 与 工作配置(/settings) 分开; settings ?tab=products 直达改用挂载后读 URL, 消除 hydration mismatch - 新增用户管理(users API/admin service/改密页) + alembic 022/023/024 - 上线部署: Dockerfile / docker-compose.prod+https / nginx https / .env.example - A8 三套正交叙事(痛点/场景/成分背书) + beige 调色去AI化 + 飞轮 text_import 高权重信号 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -14,6 +14,7 @@ from sqlalchemy.orm import Session
|
||||
from app.core.database import get_db
|
||||
from app.core.response import raise_forbidden, raise_unauthorized
|
||||
from app.core.security import decode_access_token
|
||||
from app.models.user import User
|
||||
from app.models.workspace import WorkspaceMember
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -85,6 +86,9 @@ def require_write_permission(
|
||||
current_user.workspace_id,
|
||||
)
|
||||
raise_forbidden("无权限访问此 workspace")
|
||||
user = db.query(User).filter(User.id == current_user.user_id).first()
|
||||
if user and getattr(user, "must_change_password", False):
|
||||
raise_forbidden("首次登录必须先修改密码")
|
||||
return current_user
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user