摘要: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi 阅读全文
posted @ 2021-09-27 15:31 飞渝 阅读(146) 评论(0) 推荐(0)
摘要: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi 阅读全文
posted @ 2021-09-27 09:27 飞渝 阅读(101) 评论(0) 推荐(0)
摘要: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi 阅读全文
posted @ 2021-09-26 18:27 飞渝 阅读(35) 评论(0) 推荐(0)
摘要: 方法一 在package.json中追加如下配置 "proxy":"http://localhost:5000" 说明: 优点:配置简单,前端请求资源时可以不加任何前缀。 缺点:不能配置多个代理。 工作方式:上述方式配置代理,当请求了3000不存在的资源时,那么该请求会转发给5000 (优先匹配前端 阅读全文
posted @ 2021-09-17 11:49 飞渝 阅读(113) 评论(0) 推荐(0)
摘要: fetch与axios fetch与axios的定位认识。fetch是浏览器提供的api,axios是社区封装的一个组件。 **fetch** 是一个低层次的API,你可以把它考虑成原生的XHR,所以使用起来并不是那么舒服,需要进行封装。多年来,`XMLHttpRequest`一直是web开发者的亲 阅读全文
posted @ 2021-09-16 09:21 飞渝 阅读(351) 评论(0) 推荐(0)
摘要: # 一次完整的HTTP服务过程 ### 题意分析 当我们在web浏览器的地址栏中输入:`www.baidu.com`,具体发生了什么? 1. 对`www.baidu.com`这个网址进行DNS域名解析,得到对应的IP地址 2. 根据这个IP,找到对应的服务器,发起TCP的三次握手 3. 建立TCP连 阅读全文
posted @ 2021-09-16 09:16 飞渝 阅读(191) 评论(0) 推荐(0)
摘要: 1.安装 $ npm install react-cookies --save 2.使用 /** * react-cookies封装 */ import cookie from 'react-cookies'; // 获取当前用户cookie export const loginUser = () 阅读全文
posted @ 2021-09-15 14:14 飞渝 阅读(389) 评论(0) 推荐(1)
摘要: /** * Web Storage封装 * 1.localStorage * 2.sessionStorage * 详情:https://www.cnblogs.com/fei-yu9999/p/14667831.html */ /** * 1.localStorage */ export defa 阅读全文
posted @ 2021-09-15 12:09 飞渝 阅读(97) 评论(0) 推荐(0)
摘要: /** * 对axios的封装 */ //引入axios import axios from 'axios'; //引入其它配置(根据具体需求按需引入) import { history } from 'umi'; //1.创建axios实例,默认配置也可以在具体请求内复写修改。 const ins 阅读全文
posted @ 2021-09-15 11:34 飞渝 阅读(970) 评论(0) 推荐(0)
摘要: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi 阅读全文
posted @ 2021-09-15 09:10 飞渝 阅读(114) 评论(0) 推荐(0)