helloworld180 1 month ago
parent 0504222892
commit 7808e0d3d3

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB

@ -17,7 +17,7 @@
<el-menu-item index="2-1">私信聊天</el-menu-item> <el-menu-item index="2-1">私信聊天</el-menu-item>
<el-menu-item index="2-2">社区动态</el-menu-item> <el-menu-item index="2-2">社区动态</el-menu-item>
</el-sub-menu> </el-sub-menu>
<el-menu-item index="3" disabled>情感助手</el-menu-item> <!-- <el-menu-item index="3" disabled>情感助手</el-menu-item> -->
<el-menu-item index="4">个人空间</el-menu-item> <el-menu-item index="4">个人空间</el-menu-item>
<div class="tu"> <div class="tu">
<img src="@/assets/pictures/tu.png" alt="tu" /> <img src="@/assets/pictures/tu.png" alt="tu" />

@ -202,7 +202,7 @@
</template> </template>
<script> <script>
import axios from '../utils/axiosConfig'; // import axios from '../utils/axiosConfig';
export default { export default {
name: "PreferenceForm", name: "PreferenceForm",
data() { data() {
@ -331,17 +331,17 @@ export default {
const isValid = await this.$refs.form.validate(); const isValid = await this.$refs.form.validate();
if (isValid) { if (isValid) {
// //
const response = await axios.post('/auth/login', { // const response = await axios.post('/auth/login', {
formData:this.formData // formData:this.formData
}) // })
if (response.code === 200) { // if (response.code === 200) {
// Recommenduser // Recommenduser
this.$router.push('/main/recommend/recommenduser'); this.$router.push('/main/recommend/recommenduser');
this.$message({ this.$message({
type: "success", type: "success",
message: "偏好已生成", message: "偏好已生成",
}); });
} // }
} else { } else {
// //
this.$message.error("请检查表单填写是否正确"); this.$message.error("请检查表单填写是否正确");

@ -4,7 +4,7 @@
<div class="rectangle-box"> <div class="rectangle-box">
<h1 class="title">推荐用户</h1> <h1 class="title">推荐用户</h1>
<p class="subtitle">根据你的恋爱偏好为您推荐以下用户</p> <p class="subtitle">根据你的恋爱偏好为您推荐以下用户</p>
<button class="add-button">添加</button> <div class="add-button" @click="addBtn"></div>
<div class="user-card"> <div class="user-card">
<img class="avatar" src="@/assets/pictures/touxiang.png" alt="用户头像"> <img class="avatar" src="@/assets/pictures/touxiang.png" alt="用户头像">
@ -137,6 +137,12 @@ export default {
return { return {
// //
} }
},
methods: {
addBtn() {
alert('此功能仅对VIP用户开放');
console.log('Add button clicked');
}
} }
} }
</script> </script>

@ -5,7 +5,7 @@ import {getToken} from '@/token/auth' // 注意这里使用了解构赋值来导
// 创建axios实例 // 创建axios实例
const service = axios.create({ const service = axios.create({
// 去vue.config.js文件改baseurl // 去vue.config.js文件改baseurl
baseURL: 'http://10.133.25.59:8083/loveforest/api', // 注意!! 这里全局统一加上了 '/api' 前缀但是vue.config.js文件在发送请求时去掉了/api所以页面的请求接口若有/api还是要携带/api baseURL: 'http://10.133.102.216:8080/loveforest/api', // 注意!! 这里全局统一加上了 '/api' 前缀但是vue.config.js文件在发送请求时去掉了/api所以页面的请求接口若有/api还是要携带/api
timeout: 5000, // 请求超时时间 timeout: 5000, // 请求超时时间
}); });
@ -20,6 +20,7 @@ service.interceptors.request.use(
config.headers['Authorization'] = `Bearer ${token}`; // 设置token config.headers['Authorization'] = `Bearer ${token}`; // 设置token
// axios.defaults.headers.common['Authorization'] = 'Bearer ' + token; // axios.defaults.headers.common['Authorization'] = 'Bearer ' + token;
} }
// console.log('请求头:',config.headers);
config.headers['Accept'] = 'application/json'; config.headers['Accept'] = 'application/json';
return config; return config;
}, },

@ -88,7 +88,7 @@ import HonneyBtn from './HonneyBtn.vue';
import ChatCard from './ChatCard.vue'; import ChatCard from './ChatCard.vue';
import ChatList from './ChatList.vue'; import ChatList from './ChatList.vue';
import {getToken,getUserId} from '@/token/auth' import {getToken,getUserId} from '@/token/auth'
import axios from 'axios'; import axios from '../../utils/axiosConfig';
export default { export default {
name: 'chatIndex', // name: 'chatIndex', //
data(){ data(){
@ -213,29 +213,29 @@ export default {
const response = await axios.get(`messages/poll/${UserId}`,{ const response = await axios.get(`messages/poll/${UserId}`,{
headers:{Authorization : token} headers:{Authorization : token}
}) })
if(response.data == '') if(response == '')
{ {
this.long_poll_serve() this.long_poll_serve()
}else{ }else{
const senderId = response.data[response.data.length-1].senderId const senderId = response[response.length-1].senderId
console.log(senderId) console.log(senderId)
for(let i = 0;i<this.friendsInfoList.length;i++){ for(let i = 0;i<this.friendsInfoList.length;i++){
if(this.friendsInfoList[i].id == senderId){ if(this.friendsInfoList[i].id == senderId){
let response2 = await axios.get(`/messages/chat/${UserId}/${senderId}`,{ let response2 = await axios.get(`/messages/chat/${UserId}/${senderId}`,{
headers:{Authorization : token} headers:{Authorization : token}
}) })
if(this.friendsInfoList[i].chatHistory.slice(-1)[0].time == response2.data[response2.data.length-1].timestamp.replace('T',' ')){ if(this.friendsInfoList[i].chatHistory.slice(-1)[0].time == response2[response2.length-1].timestamp.replace('T',' ')){
break break
} }
console.log(this.friendsInfoList[i].chatHistory.slice(-1),response2.data[response2.data.length-1].timestamp.replace('T',' ')) console.log(this.friendsInfoList[i].chatHistory.slice(-1),response2[response2.length-1].timestamp.replace('T',' '))
if(this.chatWith != this.friendsInfoList[i].name){ if(this.chatWith != this.friendsInfoList[i].name){
this.friendsInfoList[i].unreading_num += 1 this.friendsInfoList[i].unreading_num += 1
this.new_msg_nums += 1 this.new_msg_nums += 1
} }
let tempt_chat = {name:'',content:'',time:''} let tempt_chat = {name:'',content:'',time:''}
tempt_chat.name = this.friendsInfoList[i].name tempt_chat.name = this.friendsInfoList[i].name
tempt_chat.content = response2.data[response2.data.length-1].content tempt_chat.content = response2[response2.length-1].content
tempt_chat.time = response2.data[response2.data.length-1].timestamp.replace('T',' ') tempt_chat.time = response2[response2.length-1].timestamp.replace('T',' ')
this.friendsInfoList[i].chatHistory.push(tempt_chat) this.friendsInfoList[i].chatHistory.push(tempt_chat)
break break
} }
@ -243,7 +243,7 @@ export default {
this.long_poll_serve() this.long_poll_serve()
} }
}catch(error){ }catch(error){
alert('长轮询失败',error) // alert('',error)
} }
}, },
async revise_honneyBtn_status(userId1,userId2,status){ async revise_honneyBtn_status(userId1,userId2,status){
@ -256,7 +256,7 @@ export default {
},{ },{
headers:{Authorization : 'Bearer '+getToken()} headers:{Authorization : 'Bearer '+getToken()}
}) })
console.log(response.data) console.log(response)
}catch(error){ }catch(error){
alert('好友状态修改失败',error) alert('好友状态修改失败',error)
} }
@ -267,7 +267,7 @@ export default {
const response = await axios.post(`/messages/mark-as-read/${senderId}/${receiverId}`,{},{ const response = await axios.post(`/messages/mark-as-read/${senderId}/${receiverId}`,{},{
headers:{Authorization : 'Bearer '+getToken()} headers:{Authorization : 'Bearer '+getToken()}
}) })
console.log(response.data) console.log(response)
}catch(error){ }catch(error){
alert('消息已读失败',error) alert('消息已读失败',error)
} }
@ -282,7 +282,7 @@ export default {
},{ },{
headers:{Authorization : 'Bearer '+getToken()} headers:{Authorization : 'Bearer '+getToken()}
}) })
console.log(response.data) console.log(response)
}catch(error){ }catch(error){
alert('消息保存失败',error) alert('消息保存失败',error)
} }
@ -297,7 +297,7 @@ export default {
const response1 =await axios.get(`/relationships/${UserId}`,{ const response1 =await axios.get(`/relationships/${UserId}`,{
headers:{Authorization : token} headers:{Authorization : token}
}) })
const data = response1.data const data = response1
console.log(data) console.log(data)
for(let i = 0;i< data.length;i++) for(let i = 0;i< data.length;i++)
@ -319,7 +319,7 @@ export default {
}) })
} }
let chat_history = response2.data let chat_history = response2
console.log(chat_history) console.log(chat_history)
if(chat_history.length != 0){ if(chat_history.length != 0){

@ -196,6 +196,7 @@ export default {
regRePwd:'', regRePwd:'',
regPwd:'', regPwd:'',
code:'', code:'',
photos:''
}, },
styleObj:{ styleObj:{
bordertoprightradius:'15px', bordertoprightradius:'15px',
@ -261,17 +262,21 @@ export default {
alert('验证码错误') alert('验证码错误')
} }
try { try {
const defaultAvatarUrl = "https://file.moyublog.com/d/file/2023-03-03/d06a216a9182eb9f13843c222c7d86bb.jpg";
// //
const response = await axios.post('/auth/register', { const response = await axios.post('/auth/register', {
username: this.regUser.regUsername, username: this.regUser.regUsername,
password: this.regUser.regPwd password: this.regUser.regPwd,
photos: defaultAvatarUrl
}, {}); }, {});
// //
// this.isShow = true;
alert('注册成功'); alert('注册成功');
console.log('注册成功', response); console.log('注册成功', response);
} catch (error) { } catch (error) {
// //
alert('注册失败'+ error); alert('注册失败'+ error);
console.log('注册失败', error);
} }
} }
}, },

@ -4,7 +4,7 @@
<div class="rectangle-box"> <div class="rectangle-box">
<h1 class="title">推荐用户</h1> <h1 class="title">推荐用户</h1>
<p class="subtitle">根据你的恋爱偏好为您推荐以下用户</p> <p class="subtitle">根据你的恋爱偏好为您推荐以下用户</p>
<button class="add-button"></button> <button class="add-button" @click="addBtn"></button>
<div class="user-card"> <div class="user-card">
<img class="avatar" src="@/assets/pictures/touxiang.png" alt="用户头像"> <img class="avatar" src="@/assets/pictures/touxiang.png" alt="用户头像">
@ -137,6 +137,11 @@ export default {
return { return {
// //
} }
},
methods: {
addBtn() {
alert('该功能仅对VIP用户开放')
}
} }
} }
</script> </script>

@ -129,10 +129,11 @@
</template> </template>
<script> <script>
import {getUserId} from '@/token/auth'
import TreeChart from 'vue-tree-chart-3' import TreeChart from 'vue-tree-chart-3'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import { Plus } from '@element-plus/icons-vue' import { Plus } from '@element-plus/icons-vue'
import request from '@/utils/axiosConfig' import request from '../../utils/axiosConfig'
import { flattenTree } from '@/utils/treeUtils' import { flattenTree } from '@/utils/treeUtils'
export default { export default {
@ -288,6 +289,7 @@ export default {
}, },
created() { created() {
this.fetchTreeData() this.fetchTreeData()
this.userId = getUserId();
}, },
methods: { methods: {
// //
@ -307,10 +309,10 @@ export default {
// avatar image_url使 require // avatar image_url使 require
try { try {
// 使 require // 使 require
node.image_url = node.image_url ? require('@/assets/pictures/space/' + node.image_url) : require('@/assets/pictures/space/Inbase.png') node.image_url = node.image_url ? require('@/assets/pictures/space/' + node.image_url) : require('@/assets/pictures/1.png')
} catch (e) { } catch (e) {
// require 使 // require 使
node.image_url = require('@/assets/pictures/space/Inbase.png') node.image_url = require('@/assets/pictures/1.png')
} }
// //
@ -378,13 +380,12 @@ export default {
this.currentMember.image_url = e.target.result this.currentMember.image_url = e.target.result
} }
reader.readAsDataURL(file) reader.readAsDataURL(file)
this.currentMember.file = file;
// //
// const formData = new FormData() // const formData = new FormData()
// formData.append('file', file) // formData.append('file', file)
// API... // API...
}, },
// //
async saveMember() { async saveMember() {
const isValid = await new Promise((resolve) => { const isValid = await new Promise((resolve) => {
@ -398,18 +399,49 @@ export default {
} }
try { try {
const formData = new FormData();
// FormData
formData.append('name', this.currentMember.name);
formData.append('parentId', this.currentMember.parentId);
formData.append('relation', this.currentMember.relation);
formData.append('birthDate', this.currentMember.birthDate);
formData.append('phone', this.currentMember.phone);
formData.append('isCurrentUser', this.currentMember.isCurrentUser);
// FormData
if (this.currentMember.file) {
formData.append('file', this.currentMember.file);
}
const url = this.currentMember.id ? const url = this.currentMember.id ?
`/family-tree/${this.currentMember.id}` : `/family-tree/${this.currentMember.id}` :
'/family-tree' '/family-tree';
await request({ await request({
url, url,
method: this.currentMember.id ? 'put' : 'post', method: this.currentMember.id ? 'put' : 'post',
data: this.currentMember data: formData,
}) headers: {
'Content-Type': 'multipart/form-data'
}
});
ElMessage.success('保存成功');
this.dialogVisible = false;
this.fetchTreeData();
// const url = this.currentMember.id ?
// `/family-tree/${this.currentMember.id}` :
// '/family-tree'
// await request({
// url,
// method: this.currentMember.id ? 'put' : 'post',
// data: this.currentMember
// })
// console.log(':',response) response // console.log(':',response) response
ElMessage.success('保存成功') // ElMessage.success('')
this.dialogVisible = false // this.dialogVisible = false
this.fetchTreeData() // this.fetchTreeData()
} catch (error) { } catch (error) {
console.log('新增成员失败', this.currentMember) console.log('新增成员失败', this.currentMember)
ElMessage.error('保存失败') ElMessage.error('保存失败')

@ -10,7 +10,7 @@
<img :src="user.avatar || defaultAvatar" alt="Avatar" class="avatar"> <img :src="user.avatar || defaultAvatar" alt="Avatar" class="avatar">
<!-- 编辑头像 --> <!-- 编辑头像 -->
<label for="avatar-upload" class="edit-icon"> <label for="avatar-upload" class="edit-icon">
<input type="file" id="avatar-upload" @change="uploadImage" hidden> <input type="file" id="avatar-upload" @change="uploadImage" accept="image/*" hidden>
</label> </label>
</div> </div>
@ -53,10 +53,10 @@ export default {
return { return {
user: { user: {
avatar: '', avatar: '',
account: 'Charlene Reed', account: '用户',
email: 'charlenereed@gmail.com', email: 'charlenereed@gmail.com',
birthday: '1990-01-25', birthday: '1990-01-25',
job: 'San Jose, California, USA', job: '程序员',
name: 'Charlene Reed', name: 'Charlene Reed',
password: '', password: '',
location: 'San Jose, California, USA', location: 'San Jose, California, USA',
@ -67,11 +67,32 @@ export default {
}, },
methods: { methods: {
// //
uploadImage(event) { async uploadImage(event) {
const file = event.target.files[0]; const file = event.target.files[0];
if (file) { if (file) {
this.user.avatar = URL.createObjectURL(file); this.user.avatar = URL.createObjectURL(file);
} }
// if (!file) return;
// const formData = new FormData();
// formData.append('file', file);
// try {
// const response = await axios.post('/api/upload', formData, {
// headers: {
// 'Content-Type': 'multipart/form-data'
// }
// });
// if (response.data.url) {
// this.user.avatar = response.data.url;
// } else {
// throw new Error('');
// }
// } catch (error) {
// console.error(':', error);
// alert('');
// }
}, },
// //
async fetchUserInfo() { async fetchUserInfo() {

@ -7,7 +7,7 @@
<div class="avatar-container"> <div class="avatar-container">
<img :src="userInfo.avatar || defaultAvatar" alt="Avatar" class="avatar"> <img :src="userInfo.avatar || defaultAvatar" alt="Avatar" class="avatar">
<!-- 更多信息按钮 --> <!-- 更多信息按钮 -->
<button @click="editProfile" class="showFamilytree-btn" v-if="!this.userId"> <button @click="editProfile" class="showFamilytree-btn" v-if="!userId">
<img src="../../assets/pictures/space/more.png" alt="" style="width: 80px;"> <img src="../../assets/pictures/space/more.png" alt="" style="width: 80px;">
</button> </button>
<!-- 族谱树按钮 --> <!-- 族谱树按钮 -->
@ -19,15 +19,15 @@
<!-- 基本信息 --> <!-- 基本信息 -->
<div class="user-info"> <div class="user-info">
<h2 style="margin-bottom: 30px;">{{ userInfo.name || "加载中..." }}</h2> <h2 style="margin-bottom: 30px;">{{ userInfo.name || "用户" }}</h2>
<div class="info-container"> <div class="info-container">
<p style="margin-right: 20px;"> <p style="margin-right: 20px;">
<img src="../../assets/pictures/space/map.png" style="width: 19px; margin-right: 5px;"> <img src="../../assets/pictures/space/map.png" style="width: 19px; margin-right: 5px;">
{{ userInfo.location || "加载中..." }} {{ userInfo.location || "San Jose,California,USA" }}
</p> </p>
<p> <p>
<img src="../../assets/pictures/space/calendar.png" style="width: 17px; margin-right: 5px"> <img src="../../assets/pictures/space/calendar.png" style="width: 17px; margin-right: 5px">
{{ userInfo.joinedDate || "加载中..." }} {{ userInfo.joinedDate || "1990/01/25" }}
</p> </p>
</div> </div>
</div> </div>
@ -38,29 +38,29 @@
<img src="../../assets/pictures/space/interest.png" alt=""> <img src="../../assets/pictures/space/interest.png" alt="">
<span class="in-text"> <span class="in-text">
<span class="title">兴趣爱好:</span> <span class="title">兴趣爱好:</span>
<span class="text-content" id="interest">{{ userInfo.interests || "加载中..." }}</span> <span class="text-content" id="interest">{{ userInfo.interests || "gali建帅 马思唯最好" }}</span>
</span> </span>
</p> </p>
<p> <p>
<img src="../../assets/pictures/space/double.png" alt=""> <img src="../../assets/pictures/space/double.png" alt="">
<span class="in-text"> <span class="in-text">
<span class="title">择偶期望:</span> <span class="title">择偶期望:</span>
<span class="text-content" id="expectation">{{ userInfo.expectation || "加载中..." }}</span> <span class="text-content" id="expectation">{{ userInfo.expectation || "长期关系" }}</span>
</span> </span>
</p> </p>
<p> <p>
<img src="../../assets/pictures/space/career.png" alt=""> <img src="../../assets/pictures/space/career.png" alt="">
<span class="in-text"> <span class="in-text">
<span class="title">职业:</span> <span class="title">职业:</span>
<span class="text-content" id="career">{{ userInfo.career || "加载中..." }}</span> <span class="text-content" id="career">{{ userInfo.career || "程序员" }}</span>
</span> </span>
</p> </p>
</div> </div>
<!-- 操作按钮 --> <!-- 操作按钮 -->
<div class="actions"> <div class="actions">
<button @click="logout" v-if="!this.userId">退</button> <button @click="logout" v-if="!userId">退</button>
<button @click="privateChat" v-if="this.userId"></button> <button @click="privateChat" v-if="userId"></button>
</div> </div>
</div> </div>
@ -112,10 +112,8 @@
name:'spaceIndex', name:'spaceIndex',
data() { data() {
return { return {
myId: 0, myId: 0,
userlikelist:[], userlikelist:[],
// myfollows: [],
userInfo: { userInfo: {
name: "", // name: "", //
avatar:"", avatar:"",
@ -160,14 +158,14 @@
isLiked:false, isLiked:false,
}, },
], ],
defaultAvatar: "https://via.placeholder.com/150", // defaultAvatar: require("../../assets/pictures/space/avatar.png"), //
}; };
}, },
methods: { methods: {
async loaduserlikes() {//user async loaduserlikes() {//user
const userid = this.userId;//id const requestId = this.userId || this.myId;//id
try { try {
const response = await axios.get(`/likes/userid=${userid}`); const response = await axios.get(`/likes/userid=${requestId}`);
this.userlikelist = response; // Store the liked post IDs this.userlikelist = response; // Store the liked post IDs
// Update isLiked status for all posts // Update isLiked status for all posts
@ -180,9 +178,8 @@
console.error('Error:', error); console.error('Error:', error);
} }
axios.get(`/likes/userid=${userid}`) axios.get(`/likes/userid=${requestId}`)
.then(response => { .then(response => {
// this.userlikelist.splice(0, this.myfollows.length);
this.userlikelist.push(...response); this.userlikelist.push(...response);
return response; return response;
}) })
@ -194,12 +191,11 @@
} }
}, },
async handleLike(post) {// async handleLike(post) {//
const requestId = this.userId || this.myId;
if (!post.isLiked) {// if (!post.isLiked) {//
try { try {
const response = await axios.post(`/likes/userid=${this.userId}/postid=${post.id}`); const response = await axios.post(`/likes/userid=${requestId}/postid=${post.id}`);
if (response === "点赞成功!") { if (response === "点赞成功!") {
// this.$message.success(response);
// this.$emit('updateLikeCount', this.likeCount + 1);
post.isLiked = !post.isLiked; post.isLiked = !post.isLiked;
post.likeCount = post.likeCount + 1 ; post.likeCount = post.likeCount + 1 ;
} }
@ -213,10 +209,8 @@
} }
else {// else {//
try { try {
const response = await axios.delete(`/likes/userid=${this.userId}/postid=${post.id}`); const response = await axios.delete(`/likes/userid=${requestId}/postid=${post.id}`);
if (response === "取消点赞成功!") { if (response === "取消点赞成功!") {
// this.$message.success("");
// this.$emit('updateLikeCount', this.likeCount - 1);
post.isLiked = !post.isLiked; post.isLiked = !post.isLiked;
post.likeCount = post.likeCount - 1; post.likeCount = post.likeCount - 1;
} }
@ -233,24 +227,14 @@
async fetchUserInfo() { async fetchUserInfo() {
await this.loaduserlikes(); await this.loaduserlikes();
try { try {
const requestId = this.userId || this.myId;
// //
const response = await axios.get("/api/getUserInfo", { const response = await axios.get("/getUserInfo", {
params: { params: {
userId: this.userId, // ID userId: requestId,
}, },
}); });
//
// {
// avatar: "https://example.com/avatar.jpg",
// name: "John Doe",
// location: "San Jose, California",
// joinedDate: "2021-01-01",
// interests: ", , ",
// expectation: "",
// career: ""
// }
// //
this.userInfo.avatar = response.data.avatar; this.userInfo.avatar = response.data.avatar;
this.userInfo.name = response.data.name; this.userInfo.name = response.data.name;
@ -261,17 +245,12 @@
this.userInfo.career = response.data.career; this.userInfo.career = response.data.career;
} catch (error) { } catch (error) {
console.error("获取用户信息失败:", error); console.error("获取用户信息失败:", error);
// alert("");
} }
}, },
async fetchPostInfo() { async fetchPostInfo() {
try { try {
// const userId = this.userId; // const requestId = this.userId || this.myId;
const postResponse = await axios.get(`/posts/userid=${this.userId}`, { const postResponse = await axios.get(`/posts/userid=${requestId}`);
// params: {
// userId: userId
// }
});
// //
this.posts = postResponse.map(post => ({ this.posts = postResponse.map(post => ({
id: post.postid, id: post.postid,
@ -300,13 +279,14 @@
}, },
logout() { logout() {
this.$router.push('/') this.$router.push('/')
} },
}, },
mounted() { mounted() {
// ID
this.myId = getUserId();
// //
this.fetchUserInfo(); this.fetchUserInfo();
this.fetchPostInfo(); this.fetchPostInfo();
this.myId = getUserId();
}, },
}; };
</script> </script>

@ -6,42 +6,42 @@ module.exports = defineConfig({
https: false, https: false,
proxy:{ proxy:{
'/api': { //设置拦截器 拦截器格式 斜杠+拦截器名字,名字可以自己定 '/api': { //设置拦截器 拦截器格式 斜杠+拦截器名字,名字可以自己定
target: 'http://10.133.25.59:8083/loveforest', //代理的目标地址 target: 'http://10.133.102.216:8080/loveforest', //代理的目标地址
changeOrigin: true, //是否设置同源,输入是的 changeOrigin: true, //是否设置同源,输入是的
pathRewrite: { //路径重写 pathRewrite: { //路径重写
'^/api': '' //选择忽略拦截器里面的内容 '^/api': '' //选择忽略拦截器里面的内容
} }
}, },
'/relationships': { //设置拦截器 拦截器格式 斜杠+拦截器名字,名字可以自己定 '/relationships': { //设置拦截器 拦截器格式 斜杠+拦截器名字,名字可以自己定
target: 'https://911fb0525ms3.vicp.fun/loveforest/api/', //代理的目标地址 target: 'http://10.133.102.216:8080/loveforest', //代理的目标地址
changeOrigin: true, //是否设置同源,输入是的 changeOrigin: true, //是否设置同源,输入是的
pathRewrite: { //路径重写 pathRewrite: { //路径重写
'^/api': '' //选择忽略拦截器里面的内容 '^/api': '' //选择忽略拦截器里面的内容
} }
}, },
'/messages/chat': { //设置拦截器 拦截器格式 斜杠+拦截器名字,名字可以自己定 '/messages/chat': { //设置拦截器 拦截器格式 斜杠+拦截器名字,名字可以自己定
target: 'https://911fb0525ms3.vicp.fun/loveforest/api/', //代理的目标地址 target: 'http://10.133.102.216:8080/loveforest', //代理的目标地址
changeOrigin: true, //是否设置同源,输入是的 changeOrigin: true, //是否设置同源,输入是的
pathRewrite: { //路径重写 pathRewrite: { //路径重写
'^/api': '' //选择忽略拦截器里面的内容 '^/api': '' //选择忽略拦截器里面的内容
} }
}, },
'/messages/mark-as-read': { //设置拦截器 拦截器格式 斜杠+拦截器名字,名字可以自己定 '/messages/mark-as-read': { //设置拦截器 拦截器格式 斜杠+拦截器名字,名字可以自己定
target: 'https://911fb0525ms3.vicp.fun/loveforest/api/', //代理的目标地址 target: 'http://10.133.102.216:8080/loveforest', //代理的目标地址
changeOrigin: true, //是否设置同源,输入是的 changeOrigin: true, //是否设置同源,输入是的
pathRewrite: { //路径重写 pathRewrite: { //路径重写
'^/api': '' //选择忽略拦截器里面的内容 '^/api': '' //选择忽略拦截器里面的内容
} }
}, },
'/messages/send': { //设置拦截器 拦截器格式 斜杠+拦截器名字,名字可以自己定 '/messages/send': { //设置拦截器 拦截器格式 斜杠+拦截器名字,名字可以自己定
target: 'https://911fb0525ms3.vicp.fun/loveforest/api/', //代理的目标地址 target: 'http://10.133.102.216:8080/loveforest', //代理的目标地址
changeOrigin: true, //是否设置同源,输入是的 changeOrigin: true, //是否设置同源,输入是的
pathRewrite: { //路径重写 pathRewrite: { //路径重写
'^/api': '' //选择忽略拦截器里面的内容 '^/api': '' //选择忽略拦截器里面的内容
} }
}, },
'messages/poll': { //设置拦截器 拦截器格式 斜杠+拦截器名字,名字可以自己定 'messages/poll': { //设置拦截器 拦截器格式 斜杠+拦截器名字,名字可以自己定
target: 'https://911fb0525ms3.vicp.fun/loveforest/api/', //代理的目标地址 target: 'http://10.133.102.216:8080/loveforest', //代理的目标地址
changeOrigin: true, //是否设置同源,输入是的 changeOrigin: true, //是否设置同源,输入是的
pathRewrite: { //路径重写 pathRewrite: { //路径重写
'^/api': '' //选择忽略拦截器里面的内容 '^/api': '' //选择忽略拦截器里面的内容

Loading…
Cancel
Save