摘要: 1.解决兼容性问题: 在IE9之前的版本会加上 <!--[if lt IE 9]> <script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script> <script src="http 阅读全文
posted @ 2021-12-06 21:24 _雪 阅读(47) 评论(0) 推荐(0)
摘要: 1.终端 2.token.js对内容进行加密和解析 3.jwttest.router.js权限验证 4.app.js 除登录、注册之外都需要权限验证 5.test.html对查询、添加、删除、修改内容 @url=http://localhost:4000 @json=Content-Type: ap 阅读全文
posted @ 2021-12-03 21:13 _雪 阅读(469) 评论(0) 推荐(0)
摘要: 1.终端 启动app.js 2.mongodb.js中 3.content.router.js中 //导入 const {contentModel} = require("../mongodb"); const {success,fail}=require("../toast"); //模块导出 m 阅读全文
posted @ 2021-12-02 20:30 _雪 阅读(97) 评论(0) 推荐(0)
摘要: 1.在终端启动app.js 2.创建模块的字段 //导入mongoose const mongoose = require("mongoose"); //建立数据库连接 mongoose.connect("mongodb://127.0.0.1:27017/test"); const tagSche 阅读全文
posted @ 2021-11-30 18:56 _雪 阅读(69) 评论(0) 推荐(0)
摘要: 在Visual Studio Code上的操作 1.创建一个node_modules的文件夹2.在node_modules中创建一个content.router.js,tag.router.js,user.router.js的js文件(模块) 创建模块 终端: nodemon app.js 启动ap 阅读全文
posted @ 2021-11-29 19:24 _雪 阅读(198) 评论(0) 推荐(1)
摘要: 终端: 1.安装koa-router npm i koa-router --save //i指install 2. 用 nodemon 来代替 node 来启动应用 nodemon app.js 效果如下: app.js的代码的步骤 //引入类 //引入内部方法或属性 //const{方法或属性名} 阅读全文
posted @ 2021-11-26 22:24 _雪 阅读(613) 评论(0) 推荐(0)
摘要: koa 基于Node.js平台的下一代web开发框架(洋葱模型 一层一层往外) 1.app.js中的代码 //引入类 const Koa = require('koa'); //引入内部方法或属性 //const{方法或属性名}=request('koa); //创建对象 const app = n 阅读全文
posted @ 2021-11-25 12:21 _雪 阅读(378) 评论(0) 推荐(0)
摘要: ### 项目初始化 (需要什么就写什么 不是每次都要初始化的) `npm init` `自定义初始化` `npm init -y` `默认生成` 一般使用 -y 的时候比较多 ### 安装项目依赖(包) `npm install` `npm install 包名 --save` `当前项目可用` ` 阅读全文
posted @ 2021-11-24 20:12 _雪 阅读(115) 评论(0) 推荐(0)
摘要: 1.第三种请求json文件的方法 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> 阅读全文
posted @ 2021-11-23 22:25 _雪 阅读(70) 评论(0) 推荐(0)
摘要: 1.data.json的数据 { "status":200, "data":{ "name":"web211001", "student":[ {"id":10001,"name":"张三"}, {"id":10002,"name":"李四"}, {"id":10003,"name":"王五"} ] 阅读全文
posted @ 2021-11-22 20:27 _雪 阅读(1359) 评论(0) 推荐(0)