From 8f801aee330086955cd7cd2085b5657c2afe1962 Mon Sep 17 00:00:00 2001 From: Kaviilee Date: Sun, 26 Nov 2023 02:08:55 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E8=87=AA=E5=8A=A8=E6=84=9F=E8=B0=A2?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/macro.vue | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/src/components/macro.vue b/src/components/macro.vue index 36e9671b..cad56386 100644 --- a/src/components/macro.vue +++ b/src/components/macro.vue @@ -40,7 +40,16 @@ > 云端同步刷新 - 自动感谢 + 自动感谢
字数: @@ -120,23 +129,23 @@ export default { return this.client == "std" ? "www" : "origin"; }, baseAPI() { - return `/api/comment/post/article/${this.id}` - } + return `/api/comment/post/article/${this.id}`; + }, }, methods: { - copy: function (text, type="") { + copy: function (text, type = "") { copy(text, { success_message: "复制宏成功" }).then(() => { reportNow({ caller: type ? "macro_copy_cloud" : "macro_copy", data: { - href: `${this.prefix}:/macro/${this.id}` - } + href: `${this.prefix}:/macro/${this.id}`, + }, }); if (this.auto_thx) { this.autoReply(); } - }) + }); }, translate(data) { if (data && data.length) { @@ -173,11 +182,13 @@ export default { onAuthThxChange() { localStorage.setItem("auto_thx", this.auto_thx); }, - autoReply: function (){ + autoReply: function () { POST(`${this.baseAPI}/comment`, null, { attachmentList: [], - content: "抱走,谢谢楼主,么么哒#嘴" - }).then((responseJSON) => { + content: "抱走,谢谢楼主,么么哒#嘴", + is_template: 1, + }) + .then((responseJSON) => { if (responseJSON && ~~responseJSON.code > 0) { this.$notify({ title: "评论失败", @@ -197,7 +208,7 @@ export default { }); }) .catch(() => {}); - } + }, }, created: function () { this.data = this.ctx; @@ -230,6 +241,12 @@ export default { } .u-auto-thx { margin-left: 10px; + .flex; + align-items: center; + .el-checkbox__input { + .pr; + top: 1.5px; + } } } @media screen and (max-width: @phone) {