|
7 years ago | |
---|---|---|
src | 7 years ago | |
www | 7 years ago | |
.eslintrc | 7 years ago | |
.gitattributes | 7 years ago | |
.gitignore | 7 years ago | |
LICENSE | 7 years ago | |
README.md | 7 years ago | |
development.js | 7 years ago | |
nginx.conf | 7 years ago | |
nideshop.sql | 7 years ago | |
package.json | 7 years ago | |
pm2.json | 7 years ago | |
production.js | 7 years ago |
本项目需要配合微信小程序端使用,GitHub: https://github.com/tumobi/nideshop-mini-program
克隆项目到本地
git clone https://github.com/tumobi/nideshop
创建数据库nideshop并导入项目根目录下的nideshop.sql
CREATE SCHEMA `nideshop` DEFAULT CHARACTER SET utf8mb4 ;
注意数据库字符编码为utf8mb4
更改数据库配置 src/common/config/adapter.js
/**
* model adapter config
* @type {Object}
*/
exports.model = {
type: 'mysql',
common: {
logConnect: isDev,
logSql: isDev,
logger: msg => think.logger.info(msg)
},
mysql: {
handle: mysql,
database: 'nideshop',
prefix: 'nideshop_',
encoding: 'utf8mb4',
host: '127.0.0.1',
port: '3306',
user: 'root',
password: 'root',
dateStrings: true
}
};
填写微信登录和微信支付配置 src/common/config/config.js
// default config
module.exports = {
default_module: 'api',
weixin: {
appid: '', // 小程序 appid
secret: '', // 小程序密钥
mch_id: '', // 商户帐号ID
partner_key: '', // 微信支付密钥
notify_url: '' // 微信异步通知,例:https://www.nideshop.com/api/pay/notify
}
};
安装依赖并启动
npm install
npm start
没有域名部署参考文档:不用买域名、不用备案、不用配置https快速部署Node.js微信小程序商城(基于Node.js+MySQL+ThinkJS)
如有域名且已备案,可参考:
喜欢别忘了Star 本项目长期更新完善,欢迎Watch 交流QQ群:497145766