From 78b5f42afd12a7c9ac352740cd5d261763498b6e Mon Sep 17 00:00:00 2001 From: vapao Date: Thu, 3 Jun 2021 18:04:16 +0800 Subject: [PATCH] fix issues --- spug_web/src/pages/login/index.js | 2 +- spug_web/src/pages/system/setting/BasicSetting.js | 13 ++++++------- .../src/pages/system/setting/SecuritySetting.js | 2 +- spug_web/src/pages/system/setting/store.js | 4 ++++ 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/spug_web/src/pages/login/index.js b/spug_web/src/pages/login/index.js index 716d6bb..06382e3 100644 --- a/spug_web/src/pages/login/index.js +++ b/spug_web/src/pages/login/index.js @@ -85,7 +85,7 @@ export default function () {
logo
-
灵活、强大、功能全面的开源运维平台
+
灵活、强大、易用的开源运维平台
setLoginType(v)}> diff --git a/spug_web/src/pages/system/setting/BasicSetting.js b/spug_web/src/pages/system/setting/BasicSetting.js index 26bebc2..178916c 100644 --- a/spug_web/src/pages/system/setting/BasicSetting.js +++ b/spug_web/src/pages/system/setting/BasicSetting.js @@ -3,7 +3,7 @@ * Copyright (c) * 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 = spug; + const spugWx = spug; return (
基本设置
@@ -32,7 +31,7 @@ export default observer(function () { 如需要使用Spug的邮件、微信和短信等内置服务,请关注公众号 + help={如需要使用Spug的邮件、微信和MFA等内置服务,请关注公众号 Spug运维 @@ -40,8 +39,8 @@ export default observer(function () { 在【我的】页面获取调用凭据,否则请留空。}> setSpugKey(e.target.value)} + value={store.settings.spug_key} + onChange={e => store.update('spug_key', e.target.value)} placeholder="请输入Spug微信公众号获取到的Token"/> diff --git a/spug_web/src/pages/system/setting/SecuritySetting.js b/spug_web/src/pages/system/setting/SecuritySetting.js index bfa8f34..af2c5e8 100644 --- a/spug_web/src/pages/system/setting/SecuritySetting.js +++ b/spug_web/src/pages/system/setting/SecuritySetting.js @@ -49,7 +49,7 @@ export default observer(function () { + help="建议开启,登录时额外使用验证码进行身份验证。"> this.isFetching = false) }; + + update = (key, value) => { + this.settings[key] = value + } } export default new Store()