Ver Fonte

Merge branch 'master' of http://git.cc-lotus.info/service-platform/web-test

guhongwei há 5 anos atrás
pai
commit
655ef10476
1 ficheiros alterados com 12 adições e 7 exclusões
  1. 12 7
      src/layout/technical/semDetail.vue

+ 12 - 7
src/layout/technical/semDetail.vue

@@ -144,13 +144,18 @@ export default {
       this.$set(this, `total`, res.total);
     },
     async submit() {
-      this.form.newsid = this.newsid;
-      this.form.uid = this.user.uid;
-      let data = this.form;
-      let res = await this.commentCreate(data);
-      console.log(res);
-      this.$checkRes(res, '评论成功', '评论失败');
-      this.search();
+      if (!this.user.uid) {
+        this.$message.error('游客身份无法评论,请先登录');
+        return;
+      } else {
+        this.form.newsid = this.newsid;
+        this.form.uid = this.user.uid;
+        let data = this.form;
+        let res = await this.commentCreate(data);
+        console.log(res);
+        this.$checkRes(res, '评论成功', '评论失败');
+        this.search();
+      }
     },
   },
   filters: {