From b6fcc3d5cba5c331e98022717e1316e77c5d3d6d Mon Sep 17 00:00:00 2001
From: yma16 <17685043634@163.com>
Date: Sun, 22 May 2022 18:35:41 +0800
Subject: [PATCH] =?UTF-8?q?fix:=E8=81=8A=E5=A4=A9=E5=AE=A4=E9=85=8D?=
=?UTF-8?q?=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
config/index.js | 4 +-
src/App.vue | 6 +-
src/comment/ArticleComment.vue | 1 +
src/components/Article.vue | 298 +++++++++++++++--------------
src/components/Onlinewebsocket.vue | 13 +-
src/store/modules/user.js | 2 +-
6 files changed, 166 insertions(+), 158 deletions(-)
diff --git a/config/index.js b/config/index.js
index 6856db1..442c644 100644
--- a/config/index.js
+++ b/config/index.js
@@ -16,11 +16,11 @@ module.exports = {
changeOrigin: true, //是否允许跨越
chunkOrigins: true,
pathRewrite: {
- "^/api": "", //重写,
+ "^/api": "api", //重写,
},
},
"/ws_api/": {
- target: "http://yongma16.xyz/",
+ target: "ws://yongma16.xyz/ws/webchat/",
ws: true, //接受websocket请求
changeOrigin: true, //是否允许跨越
chunkOrigins: true,
diff --git a/src/App.vue b/src/App.vue
index 755c2ed..d457c34 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -152,12 +152,14 @@ export default {
"https://fuss10.elemecdn.com/1/8e/aeffeb4de74e2fde4bd74fc7b4486jpeg.jpeg",
],
headerData: ["从现在开始,种一棵树", "从现在开始,种一棵树"],
- readCount: 0
+ readCount: 0,
};
},
computed: {
currentUserName: function () {
- return store.state.user.userInfo.name;
+ return store.state.user.userInfo && store.state.user.userInfo.name
+ ? store.state.user.userInfo.name
+ : "游客";
},
},
mounted() {
diff --git a/src/comment/ArticleComment.vue b/src/comment/ArticleComment.vue
index f58a343..ec29a00 100644
--- a/src/comment/ArticleComment.vue
+++ b/src/comment/ArticleComment.vue
@@ -58,6 +58,7 @@ export default {
watch: {
articleId: function (newData) {
this.childArticleId = newData;
+ return newData
},
},
mounted() {
diff --git a/src/components/Article.vue b/src/components/Article.vue
index d10ac72..b96da78 100644
--- a/src/components/Article.vue
+++ b/src/components/Article.vue
@@ -210,40 +210,40 @@