diff --git a/src/Common.js b/src/Common.js
index 32de7d1..0db432d 100644
--- a/src/Common.js
+++ b/src/Common.js
@@ -142,7 +142,7 @@ export class HighlightedMarkdown extends Component {
);
diff --git a/src/Flows.js b/src/Flows.js
index 0b80a19..9e9dc95 100644
--- a/src/Flows.js
+++ b/src/Flows.js
@@ -420,7 +420,7 @@ class FlowSidebar extends PureComponent {
this.setState({
loading_status: 'done',
});
- alert('设置关注失败');
+ alert('设置关注失败\n' + e);
console.error(e);
});
}
diff --git a/src/Message.css b/src/Message.css
new file mode 100644
index 0000000..4277fe9
--- /dev/null
+++ b/src/Message.css
@@ -0,0 +1,19 @@
+.input-prepend {
+ display: inline-block;
+ background-color: #c9cccf;
+ border: 1px solid #ced4da;
+ height: 28px;
+ padding: 3px;
+ vertical-align: top;
+}
+
+.input-suf {
+ border-top-left-radius: 0;
+ border-bottom-left-radius: 0;
+ width: 90px;
+ height: 28px;
+ border: 1px solid #ced4da;
+ vertical-align: top;
+ padding: 3px;
+}
+
diff --git a/src/Message.js b/src/Message.js
index 0de7b29..0bfc985 100644
--- a/src/Message.js
+++ b/src/Message.js
@@ -2,6 +2,8 @@ import React, { PureComponent } from 'react';
import { Time } from './Common';
import { get_json } from './infrastructure/functions';
+import './Message.css';
+
export class MessageViewer extends PureComponent {
constructor(props) {
super(props);
@@ -9,6 +11,7 @@ export class MessageViewer extends PureComponent {
loading_status: 'idle',
msg: [],
};
+ this.input_suf_ref=React.createRef();
}
componentDidMount() {
@@ -32,7 +35,8 @@ export class MessageViewer extends PureComponent {
loading_status: 'done',
msg: json.data,
start_time: json.start_time,
- salt: json.salt
+ salt: json.salt,
+ tmp_token: json.tmp_token,
});
})
.catch((err) => {
@@ -46,6 +50,20 @@ export class MessageViewer extends PureComponent {
);
}
+ do_set_token() {
+ if (this.state.loading_status==='loading')
+ return;
+ if (!this.input_suf_ref.current.value) {
+ alert("不建议后缀为空");
+ return;
+ }
+ let tt = this.state.tmp_token + '_' + this.input_suf_ref.current.value;
+ console.log(tt);
+ localStorage['TOKEN'] = tt;
+ alert('已登录为临时用户,过期后需注销重新登陆');
+ window.location.reload();
+ }
+
render() {
if (this.state.loading_status === 'loading')
return
加载中……
; @@ -71,8 +89,18 @@ export class MessageViewer extends PureComponent {随机盐 {this.state.salt}
+15分钟临时token:
+