From 7137f882d86d9dbfb29ff7f810cb7ac110f66246 Mon Sep 17 00:00:00 2001 From: xuan <3142316616@qq.com> Date: Mon, 16 Dec 2024 12:55:11 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E6=8E=A5=E5=8F=A3=E5=AE=8C?= =?UTF-8?q?=E6=88=90=EF=BC=8C=E5=88=B0=E6=97=B6=E5=80=99=E6=94=B9=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=9C=B0=E5=9D=80=E7=9A=84=E6=97=B6=E5=80=99=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E5=9C=A8vue.config.js=E7=9A=84=E4=BB=A3=E7=90=86?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=99=A8=E6=94=B9=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/css/chat/chat.css | 229 ++++++++++++++++++++++++++++ src/assets/css/chat/honneyBtn.css | 27 ---- src/utils/axiosConfig.js | 6 +- src/views/chat/ChatCard.vue | 4 +- src/views/chat/ChatList.vue | 36 ++++- src/views/chat/HonneyBtn.vue | 4 +- src/views/chat/chat.vue | 241 +----------------------------- src/views/login/login.vue | 12 +- vue.config.js | 11 ++ 9 files changed, 290 insertions(+), 280 deletions(-) create mode 100644 src/assets/css/chat/chat.css delete mode 100644 src/assets/css/chat/honneyBtn.css diff --git a/src/assets/css/chat/chat.css b/src/assets/css/chat/chat.css new file mode 100644 index 00000000..e866c4ce --- /dev/null +++ b/src/assets/css/chat/chat.css @@ -0,0 +1,229 @@ +.chat-totallayout{ + display: flex; + flex-direction: row; + height: 85%; + width: 100%; + /* flex-grow: 0; + flex-shrink: 0; */ + /* background-color: aqua; */ +} +.chat-leftlayout{ + /* background-color: azure; */ + width: 25%; + height: 100%; + display: flex; + flex-direction: column; +} +.chat-middlelayout{ + background: linear-gradient(to top, #fff9a1 65%, #fcdcd7); + width: 55%; + height: 100%; + display: flex; + flex-direction: column; + position: relative; +} +.chat-rightlayout{ + /* background-color: red; */ + position: relative; + width: 20%; + height: 100%; + display: flex; + flex-direction: column; + align-items: center; + margin-top: 3%; +} +/**************整体布局***************/ +/*************左边************** *****/ +/* 第一行 */ +.chat-leftline1{ + display: flex; + /* background-color: antiquewhite; */ + align-items: center; + margin-left: 30px; + +} +.chat-leftlayout :nth-child(1){ + flex-shrink: 0; + font-size: 30px; + font-weight: 600; +} +.chat-leftline1 :nth-child(2){ + flex-shrink: 0; + font-size: 20px; + font-weight: 600; + color: rgb(61, 243, 243); + margin-left: 15px; + + position: relative; + top: 2px; + +} +/* 第二行 */ +.chat-leftline2{ + display: flex; + align-items: center; +} +#chatSearchImg{ + height: 16px; + position: relative; + left: 23px; + top: -18px; + z-index: 1; +} +#chatSearchInput{ + outline: none; + height: 30px; + width: 300px; + border: 2px solid #E44B9D; + border-radius: 8px; + padding-left: 30px; + + position: relative; + top: -18px; + + transition: all 0.5s; +} +#chatSearchInput:focus{ + border-color: #fdadd8; +} +/* 第三行 */ +.chat-leftline3{ + display: flex; + flex-direction: column; + /* align-items: center; */ +} +.chat-friends{ + display: flex; + align-items: center; + justify-content: space-between; + border-bottom: 1px solid rgb(222, 222, 222); + /* background-color: #E44B9D; */ + height: 70px; + width: 90%; + margin: 0 auto; + /* transition: all 0.2ss; */ +} +.chat-friends:hover{ + background-color: #fff2f9; +} +.chat-friends:active{ + background-color: #fcb8dd; +} +.chat-friend-text{ + position: relative; + width: 60%; + /* background-color: #E44B9D; */ + flex-shrink: 0; +} +#chatIconImg{ + height: 50px; + width: 50px; +} +/* .chat-friend-text{ + background-color: aliceblue; +} */ +#chatFriendName{ + font-size: medium; + color: black; + line-height: 10px; +} +#chatFriendMsg{ + font-size: small; + font-weight: 300; + color: gray; + /* line-height: 0px; */ +} +#chatTime{ + font-size: small; + font-weight: 300; + color: gray; + /* background-color: #fdadd8; */ +} +/*****************中间****************** */ +.send-msg{ + align-self: center; + justify-self: flex-end; + display: flex; + position: absolute; + bottom: 5%; + width: 80%; +} +#send-msg-input{ + outline: none; + border: 1px solid #E44B9D; + border-radius: 10px; + width: 90%; + margin: 5px; +} +.search-btn{ + background-image: url("@/assets/pictures/chat/SendBtn.png"); + background-size: 100% 100%; + width: 40px; + height: 40px; + border: none; + overflow: hidden; + border-radius: 10px; +} +.search-btn:active{ + background-image: url("@/assets/pictures/chat/SendBtn.png"); + background-size: 100% 100%; + width: 40px; + height: 40px; + border: none; + overflow: hidden; + border-radius: 10px; + background-color: #a75efb; +} +/*****************右边***************************/ +.friend-information{ + width: 75%; + display: flex; + justify-content: space-around; + color: gray; + position: relative; + top: 0%; +} +.friend-information p{ + position: relative; + top: -31%; +} + +.chat-special-btn{ + display: flex; + justify-content: space-around; + width: 85%; + height: 20%; +} +.chat-home-tree-btn{ + display: flex; + flex-direction: column; + justify-content: flex-end; + align-items: center; +} +.chat-home-page-btn{ + background-color: #f85096; + background-image: url('../../pictures/chat/portrait.png'); + background-size: 60% 60%; + background-position: center center; + background-repeat: no-repeat; + height: 60px;width: 60px; border: none; border-radius: 50%; +} +.chat-tree-btn{ + background-color: #a75efb; + background-image: url('../../pictures/chat/tree.png'); + background-size: 60% 60%; + background-position: center center; + background-repeat: no-repeat; + height: 60px;width: 60px; border: none; border-radius: 50%; +} +.chat-connection{ + display: flex; + width: 62%; + justify-content: space-around; +} +.chat-recomend{ + display: flex; + flex-direction: row; + justify-content: space-around; + width: 90%; +} \ No newline at end of file diff --git a/src/assets/css/chat/honneyBtn.css b/src/assets/css/chat/honneyBtn.css deleted file mode 100644 index 56693139..00000000 --- a/src/assets/css/chat/honneyBtn.css +++ /dev/null @@ -1,27 +0,0 @@ -/* 给圆形定义关键帧 */ -@keyframes switch { - 0% { - left: calc(4px * 0.2); - } - 60% { - left:calc(4px * 0.2); - width: calc(112px * 0.2); - } - 100%{ - left: calc(104px * 0.2); - } -} -@keyframes reverse_switch { - 0% { - left: calc(104px * 0.2); - - } - 60%{ - left: calc(74px * 0.2); - width: calc(112px * 0.2); - } - 100%{ - left: calc(4px * 0.2); - } -} - diff --git a/src/utils/axiosConfig.js b/src/utils/axiosConfig.js index a97b4bd8..c0dfc6da 100644 --- a/src/utils/axiosConfig.js +++ b/src/utils/axiosConfig.js @@ -4,7 +4,8 @@ import {getToken} from '@/token/auth' // 注意这里使用了解构赋值来导 // 创建axios实例 const service = axios.create({ - baseURL: 'http://47.122.59.26:8080/api', // 配置基础URL + // baseURL: 'http://47.122.59.26:8080/api', // 配置基础URL 如果服务器域名发生变化统一可以去.env文件修改 + // baseURL: 'http://10.205.10.22:8081/loveforest/api/', timeout: 5000, // 请求超时时间 }); @@ -29,7 +30,7 @@ service.interceptors.request.use( } ); -// 响应拦截器 +//响应拦截器 service.interceptors.response.use( response => { // 对响应数据做点什么 @@ -41,6 +42,7 @@ service.interceptors.response.use( // 业务错误处理,比如弹窗提示等 // return Promise.reject(new Error(res.message || 'Error')); // } else { + console.log(res) return res; // } }, diff --git a/src/views/chat/ChatCard.vue b/src/views/chat/ChatCard.vue index 749e6b16..a527e717 100644 --- a/src/views/chat/ChatCard.vue +++ b/src/views/chat/ChatCard.vue @@ -1,10 +1,10 @@ diff --git a/src/views/chat/ChatList.vue b/src/views/chat/ChatList.vue index a73fc077..bd6a11ac 100644 --- a/src/views/chat/ChatList.vue +++ b/src/views/chat/ChatList.vue @@ -1,7 +1,7 @@ @@ -28,7 +28,7 @@ export default{ status(newvalue){ this.status = newvalue this.ReviseStatus2Father(this.status) - console.log(this.newvalue) + // console.log(this.newvalue) }, Status(){ this.status = this.Status diff --git a/src/views/chat/chat.vue b/src/views/chat/chat.vue index 80f699d5..ce8e6e13 100644 --- a/src/views/chat/chat.vue +++ b/src/views/chat/chat.vue @@ -24,7 +24,7 @@
- +
@@ -59,12 +59,12 @@
你和他已经聊了{{ getFriendObject.beeing_friends_time }}天
-

关注他{{ getFriendObject.concern_status }}

+

关注他

-

拉黑他{{ getFriendObject.black_status }}

+

拉黑他

@@ -183,7 +183,7 @@ export default { this.sendingMsg = '' } this.chatWith = item.name - console.log(this.chatWith) + // console.log(this.chatWith) }, sendMsg(){ @@ -242,7 +242,7 @@ export default { } }) } - } + }, }, computed:{ getFriendObject(){ @@ -262,234 +262,5 @@ export default { \ No newline at end of file diff --git a/src/views/login/login.vue b/src/views/login/login.vue index 863b8428..64b5cdd1 100644 --- a/src/views/login/login.vue +++ b/src/views/login/login.vue @@ -225,15 +225,13 @@ export default { this.isShow = !this.isShow }, async UserLogin() { - this.$router.push('/main'); + // this.$router.push('/main'); if(this.loginUser.code === 'Yj98') { try { - const response = await axios.post('', null, { - params: { - username: this.loginUser.name, - password: this.loginUser.password - } - }); + const response = await axios.post('/auth/login', { + username: this.loginUser.name, + password: this.loginUser.password + }) console.log('登录成功', response) // 假设token在响应的data字段中 // !!存疑!! diff --git a/vue.config.js b/vue.config.js index 910e297e..2dc5ff8b 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,4 +1,15 @@ const { defineConfig } = require('@vue/cli-service') module.exports = defineConfig({ + devServer:{ + host: 'localhost', + port: 8080, + https: false, + proxy:{ + '/auth/login':{ + target : 'https://911fb0525ms3.vicp.fun/loveforest/api', + changeOrigin : true, + }, + } + }, transpileDependencies: true })