提交 86b35688 编写于 作者: yma16's avatar yma16

fix:聊天室配置

上级 dc48cf1e
......@@ -20,7 +20,7 @@ module.exports = {
},
},
"/ws_api/": {
target: "ws://yongma16.xyz/",
target: "http://yongma16.xyz/",
ws: true, //接受websocket请求
changeOrigin: true, //是否允许跨越
chunkOrigins: true,
......
......@@ -152,8 +152,7 @@ export default {
"https://fuss10.elemecdn.com/1/8e/aeffeb4de74e2fde4bd74fc7b4486jpeg.jpeg",
],
headerData: ["从现在开始,种一棵树", "从现在开始,种一棵树"],
readCount: 0,
currentUserName: "",
readCount: 0
};
},
computed: {
......
......@@ -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);
});
......
......@@ -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;
......
......@@ -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; // 函数指向
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册