From a4716de4f5946b8ab58e72c448fa7ff3f9325f15 Mon Sep 17 00:00:00 2001 From: hole-thu Date: Wed, 15 Dec 2021 18:38:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=9D=E5=AD=98=E6=8A=98=E5=8F=A0=E5=92=8C?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E5=85=81=E8=AE=B8=E6=90=9C=E7=B4=A2=E8=8D=89?= =?UTF-8?q?=E7=A8=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/UserAction.js | 11 +++++++++-- src/infrastructure/widgets.js | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/UserAction.js b/src/UserAction.js index db18ea3..dd29f44 100644 --- a/src/UserAction.js +++ b/src/UserAction.js @@ -362,8 +362,8 @@ export class PostForm extends Component { super(props); this.state = { text: '', - cw: '', - allow_search: false, + cw: window.CW_BACKUP || '', + allow_search: window.AS_BACKUP || false, loading_status: 'done', img_tip: null, preview: false, @@ -381,6 +381,11 @@ export class PostForm extends Component { if (this.area_ref.current) this.area_ref.current.focus(); } + componentWillUnmount() { + window.CW_BACKUP = this.state.cw; + window.AS_BACKUP = this.state.allow_search; + } + on_allow_search_change(event) { this.setState({ allow_search: event.target.checked, @@ -429,6 +434,7 @@ export class PostForm extends Component { }); this.area_ref.current.clear(); this.props.on_complete(); + window.CW_BACKUP = ''; }) .catch((e) => { console.error(e); @@ -644,6 +650,7 @@ export class PostForm extends Component { 允许被搜索 diff --git a/src/infrastructure/widgets.js b/src/infrastructure/widgets.js index bfc4569..aaba2ce 100644 --- a/src/infrastructure/widgets.js +++ b/src/infrastructure/widgets.js @@ -64,7 +64,7 @@ class LoginPopupSelf extends Component { e.preventDefault(); tar.href = '/_login?p=thuhole&token=' + ref.current.value; console.log(tar); - alert('应T大树洞管理员要求,已停止T大树洞token登陆'); + alert('T大树洞已经没有啦😭'); } render() {