Browse Source

fix: 在用户信息请求中添加withCredentials配置

添加withCredentials配置以确保跨域请求携带认证信息
lsc 3 tuần trước cách đây
mục cha
commit
21ae7b62b4
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      src/App.vue

+ 1 - 1
src/App.vue

@@ -231,7 +231,7 @@ const selectUser2 = (uid) => {
 
 
     // 拉取用户信息并处理
     // 拉取用户信息并处理
     const requestUser = () => {
     const requestUser = () => {
-      axios.get(`https://pbl.cocorobo.cn/api/pbl/selectUser?userid=${uid}`)
+      axios.get(`https://pbl.cocorobo.cn/api/pbl/selectUser?userid=${uid}`, { withCredentials: true })
         .then(res => {
         .then(res => {
           console.log(res);
           console.log(res);
           if (res && res.data && res.data.length && res.data[0].length && res.data[0][0].userid) {
           if (res && res.data && res.data.length && res.data[0].length && res.data[0][0].userid) {