luxiaotao1123
2024-02-28 e32ada5186e1090927301706c2d65144926d26c3
zy-asrs-flow/src/pages/account/setting/index.jsx
@@ -5,19 +5,24 @@
import SecurityView from './components/security';
import useStyles from './style.style';
const menuMap = {
    base: '基本设置',
    security: '安全设置',
};
const getMenu = () => {
    return Object.keys(menuMap).map((item) => ({ key: item, label: menuMap[item] }));
};
const Settings = () => {
    const { styles } = useStyles();
    const menuMap = {
        base: '基本设置',
        security: '安全设置',
        binding: '账号绑定',
        notification: '新消息通知',
    };
    const [initConfig, setInitConfig] = useState({
        mode: 'inline',
        selectKey: 'base',
    });
    const dom = useRef();
    const resize = () => {
        requestAnimationFrame(() => {
            if (!dom.current) {
@@ -37,6 +42,7 @@
            });
        });
    };
    useLayoutEffect(() => {
        if (dom.current) {
            window.addEventListener('resize', resize);
@@ -46,9 +52,7 @@
            window.removeEventListener('resize', resize);
        };
    }, [dom.current]);
    const getMenu = () => {
        return Object.keys(menuMap).map((item) => ({ key: item, label: menuMap[item] }));
    };
    const renderChildren = () => {
        const { selectKey } = initConfig;
        switch (selectKey) {
@@ -60,6 +64,7 @@
                return null;
        }
    };
    return (
        <GridContent>
            <div
@@ -91,4 +96,5 @@
        </GridContent>
    );
};
export default Settings;