fix issues

pull/330/head
vapao 2021-06-03 18:04:16 +08:00
parent da0f608ec2
commit 78b5f42afd
4 changed files with 12 additions and 9 deletions

View File

@ -85,7 +85,7 @@ export default function () {
<div className={styles.container}>
<div className={styles.titleContainer}>
<div><img className={styles.logo} src={logo} alt="logo"/></div>
<div className={styles.desc}>灵活强大功能全面的开源运维平台</div>
<div className={styles.desc}>灵活强大易用的开源运维平台</div>
</div>
<div className={styles.formContainer}>
<Tabs className={styles.tabs} onTabClick={v => setLoginType(v)}>

View File

@ -3,7 +3,7 @@
* Copyright (c) <spug.dev@gmail.com>
* Released under the AGPL-3.0 License.
*/
import React, { useState } from 'react';
import React from 'react';
import { observer } from 'mobx-react';
import { Form, Popover, Input, Button, message } from 'antd';
import styles from './index.module.css';
@ -11,9 +11,8 @@ import { http } from 'libs';
import store from './store';
export default observer(function () {
const [spug_key, setSpugKey] = useState(store.settings.spug_key);
function handleSubmit() {
const spug_key = store.settings.spug_key;
if (!spug_key) return message.error('请输入调用凭据');
store.loading = true;
http.post('/api/setting/', {data: [{key: 'spug_key', value: spug_key}]})
@ -24,7 +23,7 @@ export default observer(function () {
.finally(() => store.loading = false)
}
const spugWx = <img src="http://image.qbangmang.com/spug-weixin.jpeg" alt='spug'/>;
const spugWx = <img src="https://cdn.spug.cc/img/spug-weixin.jpeg" alt='spug'/>;
return (
<React.Fragment>
<div className={styles.title}>基本设置</div>
@ -32,7 +31,7 @@ export default observer(function () {
<Form.Item
label="调用凭据"
labelCol={{span: 24}}
help={<span>如需要使用Spug的邮件微信和短信等内置服务请关注公众号
help={<span>如需要使用Spug的邮件微信和MFA等内置服务请关注公众号
<span style={{color: '#008dff', cursor: 'pointer'}}>
<Popover content={spugWx}>
<span>Spug运维</span>
@ -40,8 +39,8 @@ export default observer(function () {
</span>
我的页面获取调用凭据否则请留空</span>}>
<Input
value={spug_key}
onChange={e => setSpugKey(e.target.value)}
value={store.settings.spug_key}
onChange={e => store.update('spug_key', e.target.value)}
placeholder="请输入Spug微信公众号获取到的Token"/>
</Form.Item>
<Form.Item style={{marginTop: 24}}>

View File

@ -49,7 +49,7 @@ export default observer(function () {
<Form.Item
label="登录MFA认证"
style={{marginTop: 24}}
help="建议开启,登录时额外使用短信验证码进行身份验证。">
help="建议开启,登录时额外使用验证码进行身份验证。">
<Switch
checkedChildren="开启"
unCheckedChildren="关闭"

View File

@ -21,6 +21,10 @@ class Store {
})
.finally(() => this.isFetching = false)
};
update = (key, value) => {
this.settings[key] = value
}
}
export default new Store()