diff --git a/src/Flows.js b/src/Flows.js
index b2ea2da8..80383a55 100644
--- a/src/Flows.js
+++ b/src/Flows.js
@@ -1473,15 +1473,21 @@ class SubFlow extends PureComponent {
});
localStorage['_LATEST_POST_ID'] = '' + max_id;
}
- window.TITLE = json.custom_title;
- window.AUTO_BLCOK = json.auto_block_rank;
- if (
- json.custom_title &&
- window.TITLE_SECRET !== json.title_secret
- ) {
- window.TITLE_SECRET = json.title_secret;
- localStorage['TITLE_SECRET'] = json.title_secret;
+
+ if (page === 1) {
+ window.IS_ADMIN = json.is_admin;
+ window.IS_CANDIDATE = json.is_candidate;
+ window.TITLE = json.custom_title;
+ window.AUTO_BLCOK = json.auto_block_rank;
+ if (
+ json.custom_title &&
+ window.TITLE_SECRET !== json.title_secret
+ ) {
+ window.TITLE_SECRET = json.title_secret;
+ localStorage['TITLE_SECRET'] = json.title_secret;
+ }
}
+
json.data.forEach((x) => {
if (x.comments) {
let comment_json = {
diff --git a/src/Message.css b/src/Message.css
index aaefc142..a7fd2ae8 100644
--- a/src/Message.css
+++ b/src/Message.css
@@ -16,3 +16,11 @@
vertical-align: top;
padding: 3px;
}
+
+.admin-card {
+ display: inline-block;
+ background: #3332;
+ margin-left: 7px;
+ padding: 1px 5px;
+ border-radius: 5px;
+}
diff --git a/src/Message.js b/src/Message.js
index 601377b0..2079b6e5 100644
--- a/src/Message.js
+++ b/src/Message.js
@@ -35,6 +35,8 @@ export class MessageViewer extends PureComponent {
msg: json.data,
start_time: json.start_time,
salt: json.salt,
+ admin_list: json.admin_list,
+ candidate_list: json.candidate_list,
tmp_token: json.tmp_token,
});
})
@@ -107,6 +109,24 @@ export class MessageViewer extends PureComponent {
使用
+
+
+ {this.state.is_admin && (
+ 你是管理员
+ )}
+
专属头衔:
{' '}
使用头衔
@@ -527,6 +537,7 @@ export class PostForm extends Component {
this.on_cw_change_bound = this.on_cw_change.bind(this);
this.on_poll_option_change_bound = this.on_poll_option_change.bind(this);
this.color_picker = new ColorPicker();
+ this.forced_use_title = window.IS_ADMIN || window.IS_CANDIDATE;
}
componentDidMount() {
@@ -784,7 +795,8 @@ export class PostForm extends Component {
{' '}
使用头衔