| | |
| | | import { Button, Input, message, Upload } from 'antd'; |
| | | import React from 'react'; |
| | | import useStyles from './index.style'; |
| | | import Http from '@/utils/http'; |
| | | |
| | | const queryCurrent = () => { |
| | | |
| | | } |
| | | import defaultAvat from '/public/img/defaultAva.png' |
| | | |
| | | const validatorPhone = (rule, value, callback) => { |
| | | if (!value[0]) { |
| | |
| | | const BaseView = () => { |
| | | const { styles } = useStyles(); |
| | | |
| | | // 头像组件 方便以后独立,增加裁剪之类的功能 |
| | | const AvatarView = ({ avatar }) => ( |
| | | <> |
| | | <div className={styles.avatar_title}>头像</div> |
| | |
| | | </div> |
| | | <Upload showUploadList={false}> |
| | | <div className={styles.button_view}> |
| | | <Button> |
| | | {/* <Button> |
| | | <UploadOutlined /> |
| | | 更换头像 |
| | | </Button> |
| | | </Button> */} |
| | | </div> |
| | | </Upload> |
| | | </> |
| | | ); |
| | | |
| | | const queryCurrent = async () => { |
| | | await Http.doGet('api/auth/user'); |
| | | } |
| | | |
| | | |
| | | |
| | | const { data: currentUser, loading } = useRequest(() => { |
| | | return queryCurrent(); |
| | |
| | | if (currentUser.avatar) { |
| | | return currentUser.avatar; |
| | | } |
| | | const url = 'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png'; |
| | | const url = { defaultAvat }; |
| | | return url; |
| | | } |
| | | return ''; |
| | | return defaultAvat; |
| | | }; |
| | | |
| | | const handleFinish = async () => { |
| | | message.success('更新基本信息成功'); |
| | | }; |
| | | |
| | | |
| | | return ( |
| | | <div className={styles.baseView}> |
| | | {loading ? null : ( |