摘要: 1.egg项目中安装 egg-sequelize和mysql2 npm install --save egg-sequelize mysql2 2.在plugin.js 中插入以下代码 /** @type Egg.EggPlugin */ module.exports = { // had enab 阅读全文
posted @ 2020-05-28 20:32 HLLZ 阅读(1648) 评论(0) 推荐(0) 编辑
摘要: 1.新建middleware文件 //options: 中间件的配置项,框架会将 app.config[${middlewareName}] 传递进来。 //app: 当前应用 Application 的实例。 module.exports = (options,app) => { //返回一个异步 阅读全文
posted @ 2020-05-28 15:57 HLLZ 阅读(615) 评论(0) 推荐(0) 编辑
摘要: 1.controller文件 'use strict'; const Controller = require('egg').Controller; class ArticleController extends Controller { // 创建新文章 async createArticle() 阅读全文
posted @ 2020-05-28 15:17 HLLZ 阅读(289) 评论(0) 推荐(0) 编辑
摘要: 1.安装node,这一步不做过多讲解,应该都有。 2.创建egg环境 npm i egg-init -g / cnpm i egg-init -g 有cnpm的可以选择后面的cnpm安装 3.新建项目 cd 想要创建项目的位置egg-init 项目名称 --type=simple 4.安装依赖 np 阅读全文
posted @ 2020-05-28 13:36 HLLZ 阅读(638) 评论(0) 推荐(0) 编辑
摘要: import 'package:flutter/material.dart'; /** * 第三节,商品详情页,路由传递 */ void main(){ runApp(MaterialApp( title:'JSPang', home:FirstPage(), )); } class FirstPa 阅读全文
posted @ 2020-05-28 13:30 HLLZ 阅读(626) 评论(0) 推荐(0) 编辑