摘要: token.js对内容进行加密和解析 jwttest.router.js权限验证 4.app.js 除登录、注册之外都需要权限验证 5.test.html对查询、添加、删除、修改内容 @url=http://localhost:4000 @json=Content-Type: application 阅读全文
posted @ 2021-12-04 18:30 林启 阅读(46) 评论(0) 推荐(0)
摘要: 创建模型中正则表达式: validate:{//验证 给谁验证 validator: function(v) {//验证器 怎么验证 return /[a-zA-Z0-9_]{6,12}/.test(v); }, message: "密码6-12位只能为数字字母下划线的任意组合" } 创建模型中数组 阅读全文
posted @ 2021-12-02 17:28 林启 阅读(52) 评论(0) 推荐(0)
摘要: 严格模式 在app.js 设置 //创建对象 const app = new Koa(); app.use(koaBody({ strict:false 关闭严格模式 关闭严格模式 就可以根据条件来进行删除 不关闭严格模式 不关只能获取到post参数 不关闭都响应 不获取 })); mongdb 操 阅读全文
posted @ 2021-11-30 16:53 林启 阅读(42) 评论(0) 推荐(0)
摘要: post 操作时需要 http文件 查看操作是否有效果 路由的配置: app.js: const tagRouter =require("./routers/tag.router") 路径 const userRouter =require("./routers/user.router") //引入 阅读全文
posted @ 2021-11-29 19:05 林启 阅读(45) 评论(0) 推荐(0)
摘要: // 引入对象 const Koa = require('koa'); const koaBody = require('koa-body'); const Router = require('koa-router') //引入koa-router // 引入内部方法或属性 // const({方法 阅读全文
posted @ 2021-11-26 12:16 林启 阅读(42) 评论(0) 推荐(0)
摘要: 内容在斟酌 阅读全文
posted @ 2021-11-25 19:56 林启 阅读(41) 评论(0) 推荐(0)
摘要: npm init -y 配置阶段 默认配置 也可以 npm init 回车 回车 设置 安装包: npm install + 包名 你要什么包 +啥包 npm install + 包名 -g 全局安装 装外面去了 都能使用 npm install +包名 --save 当前开发环境 只有这个项目能使 阅读全文
posted @ 2021-11-24 11:38 林启 阅读(23) 评论(0) 推荐(0)
摘要: 没想好 阅读全文
posted @ 2021-11-23 19:16 林启 阅读(23) 评论(0) 推荐(0)
摘要: 回调地狱 阅读全文
posted @ 2021-11-19 13:06 林启 阅读(334) 评论(0) 推荐(0)
摘要: function People(name){ this.name=name; } People.prototype.showName=function(){ prototype原型 console.log(this.name); } function Student(){ 函数不可以直接调用 和别的 阅读全文
posted @ 2021-11-17 20:20 林启 阅读(572) 评论(0) 推荐(0)