Skip to content

H5通过点击左侧组件,自动生成页面工具

Notifications You must be signed in to change notification settings

zwf193071/h5-editor-pages

Repository files navigation

h5-editor-pages

Project setup

npm install

启动客户端npm run dev-client 启动服务端npm run dev-server

我试过npm run dev但无法同时启动客户端和服务端,原因待查

踩过的坑

  1. 创建新的数据库h5page,但无法连接上

解决方式:在mongodb的连接地址添加?authSource=admin即可成功连接

  1. 前端接口明明已传入参数,但后台接口却显示data为空,如下代码所示
let _id = mongoose.mongo.ObjectId(ctx.params._id)
let data = ctx.request.body
console.log(data); //data为null,但参数已经传递

解决方式:在app.js里引入const bodyParser = require('koa-bodyparser');,在app.use(router.routes()); 前加上app.use(bodyParser());,即可成功获取到前端接口传递来的参数

知识点

  1. Robo 3T界面化查看mongodb

Thanks to

About

H5通过点击左侧组件,自动生成页面工具

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published