02 2022 档案
摘要:// app/controller/home.js module.exports = app => { return class HomeController extends app.Controller { async index() { const { ctx, app } = this; //
阅读全文
摘要:一、安装 npm install --save egg-redis 二、启用插件 app => config => plugin.js redis: { enable: true, package: 'egg-redis',}, 三、配置redis连接 app => config => config
阅读全文
摘要:一、select select(表名, {where条件, 列名}) const user = await this.app.mysql.select('m_user', { where: { phone: username, password: 1 }, columns: [ 'id' ],});
阅读全文
摘要:一、安装 npm install --save egg-mysql 二、启用插件 app => config => plugin.js mysql: { enable: true, package: 'egg-mysql',}, 三、配置数据库连接 app => config => config.{
阅读全文
摘要:npm i --unsafe-perm=true --allow-root
阅读全文