diff --git a/package-lock.json b/package-lock.json index 677daa64392f4ed7fdd5bfe4df4eef1748ae0abb..ac6eac81c34a5d166afe833790d1d5e4291e24e7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4053,7 +4053,7 @@ "version": "5.1.6", "resolved": "https://registry.npmmirror.com/typescript/-/typescript-5.1.6.tgz", "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", - "dev": true, + "devOptional": true, "peer": true, "bin": { "tsc": "bin/tsc", diff --git a/src/App.vue b/src/App.vue index bb6826f6c2269941eace301be0625321c5271851..a12c316de0dd86a44e86b48f8018b207f3490e7e 100644 --- a/src/App.vue +++ b/src/App.vue @@ -3,11 +3,22 @@ import { RouterView } from 'vue-router'; - + diff --git a/src/apis/sendMessage.js b/src/apis/sendMessage.js new file mode 100644 index 0000000000000000000000000000000000000000..df2fe5b79e15519df4b3ecf26d0b0bf47677b794 --- /dev/null +++ b/src/apis/sendMessage.js @@ -0,0 +1,11 @@ +import axios from '../axios/axios'; + +// 获取用户信息 + +export function sendMessage(file) { + return axios.post('/conversation/img/save', file, { + headers: { + 'Content-Type': 'multipart/form-data', + }, + }); +} diff --git a/src/apis/user.js b/src/apis/user.js index 3a32dee2ecad1aeba7a0c5529717f7ccaa92b100..dede786513743378166fe72114a950c344dfd2bd 100644 --- a/src/apis/user.js +++ b/src/apis/user.js @@ -9,7 +9,7 @@ import axios from '../axios/axios'; export function login(userName, password) { return axios.post( - '/chat/user/save', + '/login', { userName, password, diff --git a/src/apis/websockeet.js b/src/apis/websockeet.js index 6fc54f80822935887eb3bb112a7d95dc559339d0..0ef3e68848a6dd4c4b938b8c89f2815cee860e55 100644 --- a/src/apis/websockeet.js +++ b/src/apis/websockeet.js @@ -1,5 +1,5 @@ export function useWebsocket(handleMessage, userId, convId) { - const ws = new WebSocket(`ws://localhost:19000/chat/userId/1/convId/1`); + const ws = new WebSocket(`ws://localhost:19000/chat/userId/` + userId + `/convId/` + convId); const init = () => { bindEvent(); diff --git a/src/layout/components/AppMain.vue b/src/layout/components/AppMain.vue index eb771a1cff77749cc9571241c54bc61e63b2aca5..9b32457303616c8e88eecf83334a249ff98ee3f0 100644 --- a/src/layout/components/AppMain.vue +++ b/src/layout/components/AppMain.vue @@ -2,10 +2,10 @@