上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 30 下一页
摘要: 新语法: Array(3).fill() // [undefined, undefined, undefined] Array(3).fill(8) // [8, 8, 8] Array(7).fill().map((_, i) => i) // [0, 1, 2, 3, 4, 5, 6] 阅读全文
posted @ 2020-10-12 16:26 James2019 阅读(4321) 评论(0) 推荐(0) 编辑
摘要: 取出两个数组中的不同 var arr1 = [0,1,2,3,4,5]; var arr2 = [0,4,6,1,3,9]; function getArrDifference(arr1, arr2) { return arr1.concat(arr2).filter(function(v, i, 阅读全文
posted @ 2020-10-12 16:22 James2019 阅读(2903) 评论(0) 推荐(0) 编辑
摘要: 1. 安装 npm install --save egg-cors egg-jwt 2. 配置 // config/config.default.jsconfig.jwt = { secret: '123456', enable: true, // default is false match: ' 阅读全文
posted @ 2020-09-04 16:22 James2019 阅读(1681) 评论(0) 推荐(1) 编辑
摘要: // 查看实时进程top // ps列出前10个CPU使用率最高的process ps aux --sort=-pcpu | head -10 kill -9 1234 // 1234为进程号 阅读全文
posted @ 2020-09-04 11:09 James2019 阅读(1681) 评论(0) 推荐(0) 编辑
摘要: 流程: 1.客户端使用账号密码来请求服务端 2.服务端对账号密码进行校验 3.服务端生成jwt信息,并将用户id写到jwt的payload中 4.服务端将jwt信息返回给客户端 5.客户端发送获取用户信息请求并在header中带上jwt信息 6.服务端验证jwt的有效性并从中取出用户id,再根据用户 阅读全文
posted @ 2020-08-16 21:55 James2019 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 如服务器网站端口是:http://127.0.0.1:7001 nginx 可加以下配置,即可代理到7001的index.js set $node_port 7001; if ( -f $request_filename/index.html ){ rewrite (.*) $1/index.htm 阅读全文
posted @ 2020-08-11 10:56 James2019 阅读(392) 评论(0) 推荐(0) 编辑
摘要: ## 事件委托(事件代理)的作用? 支持为同一个DOM元素注册多个同类型事件 可将事件分成事件捕获和事件冒泡机制 事件委托的优点: 提高性能:每一个函数都会占用内存空间,只需添加一个事件处理程序代理所有事件,所占用的内存空间更少。 动态监听:使用事件委托可以自动绑定动态添加的元素,即新增的节点不需要 阅读全文
posted @ 2020-08-07 15:19 James2019 阅读(149) 评论(0) 推荐(0) 编辑
摘要: if (typeof __wxConfig =="object"){ let version = __wxConfig.envVersion; console.log("当前环境:" + version) if (version =="develop"){ //工具或者真机 开发环境 }else i 阅读全文
posted @ 2020-08-06 13:11 James2019 阅读(486) 评论(0) 推荐(0) 编辑
摘要: => ES8 2017 '1'.padStart(2, '*') // '*1''1'.padEnd(2, '*') // '1*''1'.padStart(6, '*#') // '*#*#*1' => ES8 2017 let obj = {name: 'james', age: 22, sex 阅读全文
posted @ 2020-08-05 23:16 James2019 阅读(101) 评论(0) 推荐(0) 编辑
摘要: 以下是官方文件上传文档 https://github.com/eggjs/egg-multipart https://eggjs.org/zh-cn/plugins/multipart.html . 阅读全文
posted @ 2020-08-01 23:30 James2019 阅读(2058) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 30 下一页