-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
51c6db9
commit 358b70f
Showing
16 changed files
with
74 additions
and
302 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,16 +2,15 @@ | |
"status": "success", | ||
"message": "获取设置成功", | ||
"result": { | ||
"keywords": ["Surmon", "前端技术开发", "JavaScript"], | ||
"keywords": ["Surmon", "JavaScript"], | ||
"ad_config": "", | ||
"_id": "589e01b75af07d59124234cd", | ||
"title": "Surmon.me", | ||
"sub_title": "来苏之望", | ||
"description": "凡心所向,素履所往;生如逆旅,一苇以航", | ||
"title": "Blog name", | ||
"sub_title": "sub title", | ||
"description": "site description", | ||
"site_url": "https://surmon.me", | ||
"site_email": "surmon@foxmail.com", | ||
"site_email": "i@example.com", | ||
"site_icp": "", | ||
"ping_sites": ["http://ping.baidu.com/ping/RPC2"], | ||
"__v": 124, | ||
"blocklist": { | ||
"ips": [ | ||
|
@@ -25,17 +24,17 @@ | |
], | ||
"mails": [ | ||
"[email protected]", | ||
"ciscolai666@gmail.com", | ||
"172632763254@qq.com", | ||
"swwerwe@163.com", | ||
"example@gmail.com", | ||
"spam@qq.com", | ||
"ham@163.com", | ||
"[email protected]", | ||
"[email protected]", | ||
"[email protected]", | ||
"[email protected]" | ||
], | ||
"keywords": ["asd", "sss", "阿什顿发", "dsds", "asasas", "sdf", "test", "阿萨德"] | ||
}, | ||
"meta": { "likes": 590 }, | ||
"meta": { "likes": 600 }, | ||
"update_at": "2019-01-23T17:44:13.425Z" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,6 @@ import { | |
Card, | ||
Table, | ||
Select, | ||
Modal, | ||
Input, | ||
Space, | ||
Divider, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,8 +7,7 @@ import { CheckOutlined, MailOutlined } from '@ant-design/icons' | |
|
||
import { RouteKey, rc } from '@/routes' | ||
import { ImageUploader } from '@/components/common/ImageUploader' | ||
import { Auth, AvatarType } from '@/constants/auth' | ||
import { getGravatar } from '@/transforms/avatar' | ||
import { Auth } from '@/constants/auth' | ||
import { scrollTo } from '@/services/scroller' | ||
import { removeToken } from '@/services/token' | ||
import { useAdminState } from '@/state/admin' | ||
|
@@ -48,6 +47,7 @@ export const AuthForm: React.FC<BaseFormProps> = (props) => { | |
|
||
const handleSubmit = () => { | ||
form.validateFields().then((newAdminAuth) => { | ||
Reflect.deleteProperty(newAdminAuth, 'rel_new_password') | ||
updateAdminAuth({ | ||
...adminAuth.data, | ||
...newAdminAuth, | ||
|
@@ -85,52 +85,13 @@ export const AuthForm: React.FC<BaseFormProps> = (props) => { | |
wrapperCol={{ span: props.wrapperSpan }} | ||
> | ||
<Form.Item | ||
name="avatar_type" | ||
label="个人头像" | ||
name="avatar" | ||
label="头像" | ||
required={true} | ||
wrapperCol={{ span: 6 }} | ||
rules={[{ required: true }]} | ||
rules={[{ required: true, message: '请上传图片' }]} | ||
> | ||
<Select | ||
options={[ | ||
{ | ||
label: 'Gravatar', | ||
value: AvatarType.Gravatar, | ||
}, | ||
{ | ||
label: '自定义', | ||
value: AvatarType.URL, | ||
}, | ||
]} | ||
/> | ||
</Form.Item> | ||
<Form.Item noStyle={true} shouldUpdate={true}> | ||
{(formValues) => { | ||
const avatarType = formValues.getFieldValue('avatar_type') | ||
if (avatarType === AvatarType.Gravatar) { | ||
return ( | ||
<Form.Item label="Gravatar" wrapperCol={{ span: 6 }}> | ||
<Avatar | ||
shape="square" | ||
style={{ width: '100%' }} | ||
src={getGravatar(formValues.getFieldValue('email'))} | ||
/> | ||
</Form.Item> | ||
) | ||
} | ||
|
||
return ( | ||
<Form.Item | ||
name="avatar" | ||
label="头像地址" | ||
required={true} | ||
wrapperCol={{ span: 6 }} | ||
rules={[{ required: true, message: '请上传图片' }]} | ||
> | ||
<ImageUploader disabledMarkdown={true} /> | ||
</Form.Item> | ||
) | ||
}} | ||
<ImageUploader disabledMarkdown={true} /> | ||
</Form.Item> | ||
<Form.Item | ||
name="name" | ||
|
@@ -142,36 +103,19 @@ export const AuthForm: React.FC<BaseFormProps> = (props) => { | |
</Form.Item> | ||
<Form.Item | ||
name="slogan" | ||
label="个人签名" | ||
label="签名" | ||
required={true} | ||
rules={[{ required: true, message: '请输入签名' }]} | ||
> | ||
<Input placeholder="个人签名" /> | ||
</Form.Item> | ||
<Form.Item | ||
name="email" | ||
label="个人邮箱" | ||
required={true} | ||
rules={[ | ||
{ | ||
message: '请输入', | ||
required: true, | ||
}, | ||
{ | ||
message: '请输入正确的邮箱地址', | ||
type: 'email', | ||
}, | ||
]} | ||
> | ||
<Input suffix={<MailOutlined />} placeholder="[email protected]" /> | ||
<Input placeholder="签名" /> | ||
</Form.Item> | ||
<Divider /> | ||
<Form.Item | ||
name="password" | ||
label="旧密码" | ||
rules={[ | ||
{ | ||
message: '确认新旧密码一致且有效', | ||
message: '确保新旧密码不一致,且有效', | ||
validator: validatePassword, | ||
}, | ||
]} | ||
|
@@ -183,7 +127,7 @@ export const AuthForm: React.FC<BaseFormProps> = (props) => { | |
label="新密码" | ||
rules={[ | ||
{ | ||
message: '确认新旧密码一致且有效', | ||
message: '确保新旧密码不一致,且有效', | ||
validator: validatePassword, | ||
}, | ||
]} | ||
|
@@ -195,7 +139,7 @@ export const AuthForm: React.FC<BaseFormProps> = (props) => { | |
label="确认新密码" | ||
rules={[ | ||
{ | ||
message: '确认新旧密码一致且有效', | ||
message: '确保新旧密码不一致,且有效', | ||
validator: validatePassword, | ||
}, | ||
]} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.