axios配置,then的条件
fiddler
手机抓包(手机和电脑连同一wifi,手机配wifi代理 到指定端口)
- fiddler的 https 和 允许远程计算机连接 都配好后
- 电脑和手机连同一wifi,查看电脑的ip地址,192.168.x.x
- 手机wifi配置代理:手动 主机名:电脑ip 端口:8888 (fiddler的端口)
- 注:若后端接口是内网,电脑开vpn连接内网后,手机不用装fiddler的证书,配上这个代理就能访问内网
- 手机自带浏览器访问(下载完后好找文件) 电脑ip:8888 可看到fiddler的页面,最后一行点击下载证书(如果手机访问http链接,不下这个证书也能用)
- 手机 设置->用户凭据->从存储设备安装->CA证书 找到文件,点击即可安装
- //卸载证书时:用户凭据->看到自己安装的证书,点击删除即可
当给微信抓包时,微信公众号h5没问题,微信小程序不行。可以电脑端打开微信小程序,再用fiddler抓(电脑端微信小程序一些功能可能会打不开)//想测试小程序最好还是用开发者工具
隐藏tunnel to
限速
- 修改限速规则
- 可以加载页面时先不开限速,等要提交/关键测试接口时,再开限速
if (m_SimulateModem) {
// Delay sends by 300ms per KB uploaded.网络请求的延迟时间
oSession["request-trickle-delay"] = "100";
// Delay receives by 150ms per KB downloaded.网络响应的延迟时间
oSession["response-trickle-delay"] = "100";
}
- 开启限速
微信公众号授权
scope为"snsapi_userinfo"
以vue为例,若created时直接跳授权链接,且scope为手动授权,实际效果是静默授权,也会有个code,但不是想要的
必须页面点击之类的,有事件触发后再跳转授权链接,才能真正触发手动授权
企微应用 网页的手动授权 能进页面直接触发
scss变量配合交集选择器失效
- scss变量配合交集选择器使用时 无效,直接渲染最后一个变量,不分辨交集
- 使用css变量正常
--color: #b60202;
$color: #b60202;
&.online {
--color: #4a9d6b;
$color: #4a9d6b;
}
display: flex;
align-items: center;
position: absolute;
right: 10px;
bottom: 20px;
color: $color;
&::before {
content: '';
display: block;
width: 10px;
height: 10px;
background-color: var(--color);
border-radius: 50%;
margin-right: 5px;
}
}
找两个数组重叠部分
arr1.filter(el=>arr2.includes(el))
- 场景:选中一部分人,改变搜索条件,要把当前展示列表中 之前选中的人保留
selList = showList.filter(el=>selList.includes(el))
in 和 of
in
- 用法1(判断对象是否存在某个键名)
- 'a' in {a:13} //true
- if(key in obj){...}
- 用法2(遍历对象//虽然也能遍历数组,不推荐)
- for(let key in obj){...}
of
- for(let item of [1,2,3,4]){console.log(item)}
- 用来遍历数组项,字符串(不能遍历对象)
- for… of 不同与 forEach, 它可以与 break、continue和return 配合使用,也就是说 for… of 循环可以随时退出循环。
函数没默认值时报错
const required = () => { throw new Error("This function requires one parameter.") } function double(value = required()) { return value * 2 }
double() // throw Error