diff --git a/config/index.js b/config/index.js index 4e9eef4c180d79c03fa6385187e6a145f284e299..6856db1c64c501860a246a11a87428864242498a 100644 --- a/config/index.js +++ b/config/index.js @@ -20,7 +20,7 @@ module.exports = { }, }, "/ws_api/": { - target: "ws://yongma16.xyz/", + target: "http://yongma16.xyz/", ws: true, //接受websocket请求 changeOrigin: true, //是否允许跨越 chunkOrigins: true, diff --git a/src/App.vue b/src/App.vue index d877b712223b43d34204e6885a4b740db634dc1b..755c2ed8f19223cc9eeac8718f2c5937ac6dadee 100644 --- a/src/App.vue +++ b/src/App.vue @@ -152,8 +152,7 @@ export default { "https://fuss10.elemecdn.com/1/8e/aeffeb4de74e2fde4bd74fc7b4486jpeg.jpeg", ], headerData: ["从现在开始,种一棵树", "从现在开始,种一棵树"], - readCount: 0, - currentUserName: "", + readCount: 0 }; }, computed: { diff --git a/src/comment/ArticleComment.vue b/src/comment/ArticleComment.vue index 9f5e5d18b449fa7f7d7c87af343a01babc945235..f58a34359a4afd92302fdb630dec8be31b105553 100644 --- a/src/comment/ArticleComment.vue +++ b/src/comment/ArticleComment.vue @@ -52,10 +52,16 @@ export default { contentRes: [], userId: "匿名", articleCommit: "", + childArticleId: "", }; }, + watch: { + articleId: function (newData) { + this.childArticleId = newData; + }, + }, mounted() { - articleId && this.getComments(); + this.childArticleId && this.getComments(this.childArticleId); }, methods: { dateToString(dateValue) { @@ -105,11 +111,11 @@ export default { item.date = that.dateToString(item.date); }); } catch (e) { - throw Error(e) + throw Error(e); } }) .catch((r) => { - throw Error(r) + throw Error(r); }); }, increment(userId, articleId, content) { @@ -149,7 +155,7 @@ export default { item.date = that.dateToString(item.date); }); } catch (e) { - throw Error(e) + throw Error(e); } }) .catch((r) => { @@ -158,7 +164,7 @@ export default { path: "/login", }) .catch((error) => { - throw Error(error) + throw Error(error); }); throw Error(r); }); diff --git a/src/components/Article.vue b/src/components/Article.vue index aba6125d4dc8a9094d095e2333cfab994de5bed4..d10ac72d991f635331a348f7850e1cce5dcc0cc5 100644 --- a/src/components/Article.vue +++ b/src/components/Article.vue @@ -396,7 +396,7 @@ export default { }); break; case "vue3测试平台": - window.open("http://yongma16.xyz/" + "emoji_api/index/"); + window.open("http://yongma16.xyz/emoji_api/"); break; default: break; diff --git a/src/components/Onlinewebsocket.vue b/src/components/Onlinewebsocket.vue index b8a77f340c07b5834696b51b53aa7cca40609b4f..290decd6c7167eaf36a55ba439208e8a7506b7f1 100644 --- a/src/components/Onlinewebsocket.vue +++ b/src/components/Onlinewebsocket.vue @@ -344,7 +344,7 @@ export default { console.log("创建房间出错", e); } this.chatRoomIndex = chatRoomIndex; - const wsUrl = this.websocketUrl + "ws/webchat/"; + const wsUrl = this.websocketUrl + "webchat/room/"; this.websocket = new WebSocket(wsUrl + room + "/"); // 连接 console.log(this.websocket, "聊天室"); this.websocket.onmessage = this.websocketMessage; // 函数指向