fix: bug修复
This commit is contained in:
@@ -33,6 +33,7 @@ const UserSetting: FunctionComponent = observer(() => {
|
||||
const userId: any = store.getUserId();
|
||||
async function getUserInfo() {
|
||||
getUserInfoApi(userId).then((res: any) => {
|
||||
console.log(res);
|
||||
if (res && res.success && res.data) {
|
||||
setUserInfo(res.data);
|
||||
setLoading(false);
|
||||
@@ -40,8 +41,8 @@ const UserSetting: FunctionComponent = observer(() => {
|
||||
});
|
||||
}
|
||||
type FieldType = {
|
||||
nickname?: string;
|
||||
location?: string;
|
||||
nickName?: string;
|
||||
// location?: string;
|
||||
introduce?: string;
|
||||
gender?: string;
|
||||
company?: string;
|
||||
@@ -64,7 +65,7 @@ const UserSetting: FunctionComponent = observer(() => {
|
||||
}
|
||||
const onFinish: FormProps<FieldType>["onFinish"] = (values) => {
|
||||
const data: any = {
|
||||
userId: userId,
|
||||
id: userId,
|
||||
...values,
|
||||
};
|
||||
updateUserInfo(data).then((res: any) => {
|
||||
@@ -92,24 +93,22 @@ const UserSetting: FunctionComponent = observer(() => {
|
||||
getUserInfo().then();
|
||||
}, []);
|
||||
const prefixSelector = (
|
||||
<Form.Item name="prefix" noStyle>
|
||||
<Select style={{ width: 90 }}>
|
||||
<Select.Option value="https://">https://</Select.Option>
|
||||
<Select.Option value="http://">http://</Select.Option>
|
||||
</Select>
|
||||
</Form.Item>
|
||||
<Select style={{ width: 90 }}>
|
||||
<Select.Option value="https://">https://</Select.Option>
|
||||
<Select.Option value="http://">http://</Select.Option>
|
||||
</Select>
|
||||
);
|
||||
const ProFormText = (props: any) => {
|
||||
return (
|
||||
<ProForm.Item {...props} style={{ height: "10px" }}>
|
||||
<ProFormCascader
|
||||
request={async () => city}
|
||||
width="md"
|
||||
name="location"
|
||||
disabled={disable}></ProFormCascader>
|
||||
</ProForm.Item>
|
||||
);
|
||||
};
|
||||
// const ProFormText = (props: any) => {
|
||||
// return (
|
||||
// <ProForm.Item {...props} style={{ height: "10px" }}>
|
||||
// <ProFormCascader
|
||||
// request={async () => city}
|
||||
// width="md"
|
||||
// name="location"
|
||||
// disabled={disable}></ProFormCascader>
|
||||
// </ProForm.Item>
|
||||
// );
|
||||
// };
|
||||
useEffect(() => {}, []);
|
||||
const TabItems = [
|
||||
{
|
||||
@@ -142,7 +141,7 @@ const UserSetting: FunctionComponent = observer(() => {
|
||||
{/*</Form.Item>*/}
|
||||
<Form.Item<FieldType>
|
||||
label="昵称"
|
||||
name="nickname"
|
||||
name="nickName"
|
||||
rules={[
|
||||
{
|
||||
type: "string",
|
||||
@@ -167,12 +166,12 @@ const UserSetting: FunctionComponent = observer(() => {
|
||||
<Select.Option value="UNKNOWN">隐私</Select.Option>
|
||||
</Select>
|
||||
</Form.Item>
|
||||
<Form.Item<FieldType>
|
||||
label="地区"
|
||||
name="location"
|
||||
rules={[{ required: true, message: "请输入地区!" }]}>
|
||||
<ProFormText />
|
||||
</Form.Item>
|
||||
{/*<Form.Item<FieldType>*/}
|
||||
{/* label="地区"*/}
|
||||
{/* name="location"*/}
|
||||
{/* rules={[{ required: true, message: "请输入地区!" }]}>*/}
|
||||
{/* <ProFormText />*/}
|
||||
{/*</Form.Item>*/}
|
||||
<Form.Item<FieldType> label="公司" name="company">
|
||||
<Input allowClear disabled={disable} />
|
||||
</Form.Item>
|
||||
@@ -240,7 +239,7 @@ const UserSetting: FunctionComponent = observer(() => {
|
||||
type="text"
|
||||
onClick={async () => {
|
||||
const data: any = {
|
||||
userId: userId,
|
||||
id: userId,
|
||||
password: password,
|
||||
};
|
||||
await updateUser(data);
|
||||
@@ -264,7 +263,7 @@ const UserSetting: FunctionComponent = observer(() => {
|
||||
type="text"
|
||||
onClick={async () => {
|
||||
const data: any = {
|
||||
userId: userId,
|
||||
id: userId,
|
||||
phone: phone,
|
||||
};
|
||||
await updateUser(data);
|
||||
@@ -288,7 +287,7 @@ const UserSetting: FunctionComponent = observer(() => {
|
||||
type="text"
|
||||
onClick={async () => {
|
||||
const data: any = {
|
||||
userId: userId,
|
||||
id: userId,
|
||||
email: email,
|
||||
};
|
||||
await updateUser(data);
|
||||
@@ -323,14 +322,14 @@ const UserSetting: FunctionComponent = observer(() => {
|
||||
<Flex vertical={true} justify={"flex-start"}>
|
||||
<Flex vertical={false} align={"center"}>
|
||||
<span style={{ color: "grey" }}>用户名:</span>
|
||||
<span style={{ width: 130 }}>{userInfo.userName}</span>
|
||||
<span style={{ width: 200 }}>{userInfo.userName}</span>
|
||||
</Flex>
|
||||
<Flex
|
||||
vertical={false}
|
||||
align={"center"}
|
||||
style={{ marginTop: 20 }}>
|
||||
<span style={{ color: "grey" }}>账号ID:</span>
|
||||
<span style={{ width: 130 }}>{userInfo.id}</span>
|
||||
<span style={{ width: 200 }}>{userInfo.id}</span>
|
||||
</Flex>
|
||||
</Flex>
|
||||
<Flex vertical={true} style={{ marginLeft: 50 }}>
|
||||
|
Reference in New Issue
Block a user