江辰

博客

JS 语法规范

发布于 # JS

采用小写驼峰式命名 // good studentInfo // bad studentinfo STUDENTINFO 常量命名方式 // good const COL_NUM = 10; // bad const col_num = 10; 使用字面量 // good const obj = { name:'faker' } // bad let obj = {}; obj.name = 'faker'; 函数参数使用解构 // good function createPerson({ name, age }) { // ... } createPerson({ name: 'Faker', age: 18, }); // bad function createPerson(name, age) { // ... } 使用参数默认

CircleCI 自动化部署

发布于 # CircleCI

Curl 请求如何设置 终端设置代理 $ export https_proxy=http://127.0.0.1:8888 $ export http_proxy=http://127.0.0.1:8888 取消终端代理 $ unset http_proxy $ unset https_proxy Charles Proxy 设置 输入端口 curl 发起请求 curl -X POST 127.0.0.1:8888 -H "Content-Type: application/x-www-form-urlencoded" -i https://ip:8118/mcpinterf/user/login -d "userId=45729907&imeiNo=99001123927671&simNo=89860315540101069256&pwd=eb4UecxU3

Charles 如何扑获 curl 和 Postman 请求

发布于 # React

Curl 请求如何设置 终端设置代理 $ export https_proxy=http://127.0.0.1:8888 $ export http_proxy=http://127.0.0.1:8888 取消终端代理 $ unset http_proxy $ unset https_proxy Charles Proxy 设置 输入端口 curl 发起请求 curl -X POST 127.0.0.1:8888 -H "Content-Type: application/x-www-form-urlencoded" -i https://ip:8118/mcpinterf/user/login -d "userId=45729907&imeiNo=99001123927671&simNo=89860315540101069256&pwd=eb4UecxU3

16进制和字符串互转

发布于 # React

字符串转 16 进制 function strToHexCharCode(str) { if(str === '') return ''; let hexCharCode = []; hexCharCode.push('0x'); for(var i = 0; i < str.length; i++) { hexCharCode.push((str.charCodeAt(i)).toString(16)); } return hexCharCode.join(''); } 16 进制转字符串 function hexCharCodeToStr(hexCharCodeStr) { const trimedStr = hexCharCodeStr.trim(); const rawStr = trimedS