摘要: node接口跨域 解决方案 // 解决跨域问题 app.all("*",function(req,res,next){ // 设置允许跨域的域名,*代表允许任意域名跨域 res.header('Access-Control-Allow-Origin','*'); // 允许的header类型 res 阅读全文
posted @ 2022-10-14 15:27 HuangBingQuan 阅读(52) 评论(0) 推荐(0) 编辑
摘要: 在项目中封装自己的axios 在src目录下建立一个unit文件夹 // unit => http.js import axios from "axios"; const http = axios.create({ baseURL: "xxxx", // 设置基础路径 timeout: xxxx / 阅读全文
posted @ 2022-10-14 10:34 HuangBingQuan 阅读(116) 评论(0) 推荐(0) 编辑