#
luxiaotao1123
2024-02-27 f6dcf290ac1c3bae018465f2336cae69a52b0e34
#
2个文件已修改
30 ■■■■ 已修改文件
zy-asrs-flow/src/pages/account/setting/components/base.jsx 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/pages/account/setting/index.jsx 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/pages/account/setting/components/base.jsx
@@ -28,6 +28,7 @@
const BaseView = () => {
  const { styles } = useStyles();
  // 头像组件 方便以后独立,增加裁剪之类的功能
  const AvatarView = ({ avatar }) => (
    <>
@@ -45,9 +46,11 @@
      </Upload>
    </>
  );
  const { data: currentUser, loading } = useRequest(() => {
    return queryCurrent();
  });
  const getAvatarURL = () => {
    if (currentUser) {
      if (currentUser.avatar) {
@@ -58,9 +61,11 @@
    }
    return '';
  };
  const handleFinish = async () => {
    message.success('更新基本信息成功');
  };
  return (
    <div className={styles.baseView}>
      {loading ? null : (
@@ -152,4 +157,5 @@
    </div>
  );
};
export default BaseView;
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;