diff --git a/config/index.js b/config/index.js index 6856db1c64c501860a246a11a87428864242498a..442c644cd17c96399c2da3d2fd35021b436e8813 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 755c2ed8f19223cc9eeac8718f2c5937ac6dadee..d457c349bee34f42fc5043b8e50eafc5e051204e 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 f58a34359a4afd92302fdb630dec8be31b105553..ec29a00ec1532da2db2d9dc107e76ca1558692cf 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 d10ac72d991f635331a348f7850e1cce5dcc0cc5..b96da787ffcf13372068c7080efd8d6b9fa4a10e 100644 --- a/src/components/Article.vue +++ b/src/components/Article.vue @@ -210,40 +210,40 @@