From e79910b9150ba9ac7c95588fd3c58e6c0a7164db Mon Sep 17 00:00:00 2001 From: hole-thu Date: Fri, 4 Sep 2020 20:19:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=B3=BB=E7=BB=9F=E6=97=A5?= =?UTF-8?q?=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Message.js | 52 +++++++++++++++++++++++++++++++---------------- src/UserAction.js | 8 ++++---- 2 files changed, 38 insertions(+), 22 deletions(-) diff --git a/src/Message.js b/src/Message.js index a869a465..0de7b29c 100644 --- a/src/Message.js +++ b/src/Message.js @@ -1,5 +1,6 @@ import React, { PureComponent } from 'react'; import { Time } from './Common'; +import { get_json } from './infrastructure/functions'; export class MessageViewer extends PureComponent { constructor(props) { @@ -22,17 +23,17 @@ export class MessageViewer extends PureComponent { }, () => { fetch( - '/_api/v1/system_msg?user_token=' + + '/_api/v1/systemlog?user_token=' + encodeURIComponent(this.props.token) ) .then(get_json) .then((json) => { - if (json.error) throw new Error(json.error); - else - this.setState({ - loading_status: 'done', - msg: json.result, - }); + this.setState({ + loading_status: 'done', + msg: json.data, + start_time: json.start_time, + salt: json.salt + }); }) .catch((err) => { console.error(err); @@ -61,17 +62,32 @@ export class MessageViewer extends PureComponent { ); else if (this.state.loading_status === 'done') - return this.state.msg.map((msg) => ( -
-
-
-
-
{msg.content}
-
-
- )); + return ( + <> +
+

+ 最近一次重置

+

+ 随机盐 {this.state.salt} +

+ {this.state.msg.map((msg) => ( +
+
+
+
+
{msg.detail}
+
+
+ ))} + + ) else return null; } } diff --git a/src/UserAction.js b/src/UserAction.js index fdcbb75e..cf79c05d 100644 --- a/src/UserAction.js +++ b/src/UserAction.js @@ -160,15 +160,15 @@ export class LoginForm extends Component { { this.props.show_sidebar( - '系统消息', + '系统日志', , ); }} > - 查看系统消息 + 查看系统日志
- 当您发送的内容违规时,我们将用系统消息提示您 + 举报记录、管理日志等都是公开的

{token.value} @@ -177,7 +177,7 @@ export class LoginForm extends Component { 复制 User Token
- User Token仅用于开发bot,切勿告知他人。若怀疑被盗号请刷新Token。 + User Token仅用于开发bot,切勿告知他人。若怀疑被盗号请刷新Token(刷新功能即将上线)。

) : (