feat(knowledge): enhance knowledge base detail page with embedded views

This commit is contained in:
2025-11-18 15:53:54 +08:00
parent fc0b7b2cc9
commit 8ceff84776
8 changed files with 211 additions and 165 deletions

View File

@@ -6,10 +6,12 @@ import ProfileForm from "./components/ProfileForm";
import ChangePasswordDialog from "./components/ChangePasswordDialog";
import { useProfileSetting } from "@/hooks/setting-hooks";
import logger from "@/utils/logger";
import { useUserData } from "@/hooks/useUserData";
function ProfileSetting() {
const { t } = useTranslation();
const { userInfo, updateUserInfo: updateUserInfoFunc, changeUserPassword: changeUserPasswordFunc } = useProfileSetting();
const { refreshUserData } = useUserData();
const [passwordDialogOpen, setPasswordDialogOpen] = useState(false);
logger.debug('userInfo', userInfo);
@@ -25,7 +27,10 @@ function ProfileSetting() {
return (
<Box sx={{ maxWidth: 800, mx: 'auto', p: 3 }}>
{/* 个人资料表单 */}
<ProfileForm userInfo={userInfo} onSubmit={updateUserInfoFunc} />
<ProfileForm userInfo={userInfo} onSubmit={async (data) => {
await updateUserInfoFunc(data);
await refreshUserData();
}} />
{/* 分割线 */}
<Divider sx={{ my: 4 }} />