- 安装软件
- 拉取代码
git clone https://github.com/vinzid/wechat-third.git && cd wechat-third
- 安装依赖
npm i --no-save
- 启动 mongoDB
"C:/Program Files/MongoDB/Server/3.6/bin/mongod.exe"
- 添加初始数据
"C:/Program Files/MongoDB/Server/3.6/bin/mongo.exe"
use wechatThird
db.permission.insertMany([
{"type" : "notify", "act" : "*", "anonym" : true },
{"type" : "develop", "act" : "bat", "title" : "批处理", "role" : [ "super", "admin" ], "menu" : true, "order" : 100 },
{"type" : "user", "act" : "appids", "title" : "已授权", "menu" : true, "order" : 100 },
{"type" : "request", "act" : "authorize", "title" : "授权", "menu" : true, "order" : 100 },
{"type" : "develop", "act" : "data", "title" : "数据", "role" : [ "super", "admin", "developer" ], "menu" : true, "order" : 100 },
{"type" : "develop", "act" : "mongo", "title" : "数据库", "role" : [ "super", "admin", "developer" ], "menu" : true, "order" : 100 },
{"type" : "develop", "act" : "command", "title" : "命令", "role" : [ "super" ], "menu" : true, "order" : 100 },
{"type" : "develop", "act" : "*", "role" : [ "super", "admin" ] }
{"type" : "user", "act" : "setting", "title" : "设置", "menu" : true, "order" : 100 },
{"type" : "admin", "act" : "*", "role" : [ "super", "admin" ] }
{"type" : "admin", "act" : "list", "query" : "collection=user", "title" : "用户", "role" : [ "super", "admin" ], "menu" : true, "order" : 100 }
{"type" : "user", "act" : "logout", "title" : "退出", "menu" : true, "order" : 1000 }
])
- 添加配置文件(config/common.json)
{
"token": "TOKEN",
"key": "KEY",
"appid": "APPID",
"secret": "SECRET",
"api": "api.weixin.qq.com",
"cache": "-P PORT user@ip:/PATH/TO/CACHE",
"domain": ["DOMAIN1", "DOMAIN2"],
"sync": {
"testing": "PRODUCTION_DOMAIN",
"production": "TESTING_DOMAIN"
},
"dir": {
"cache": "./data/cache/",
"config": "./data/config/",
"session": "./data/session/",
"message": "./data/message/",
"commit": "./data/commit/",
"submit": "./data/submit/",
"audit": "./data/audit/",
"publish": "./data/publish/",
"log": "./data/log/",
"qrcode": "./data/qrcode/",
"notify": "./data/notify/",
"beta": "./data/beta/"
},
"notifyEnv": "production",
"notifyTest": "TESTING_DOMAIN",
"login": {
"appid": "APPID",
"secret": "SECRET",
"domain": "DOMAIN"
},
"service": {
"key": "KEY",
"secret": "SECRET"
},
"mainAppid": "MAIN_APPID",
"ip": {
"development": "DEVELOPMENT_IP",
"testing": "TESTING_IP",
"production": "PRODUCTION_IP"
}
}
- 运行 Node.js服务
node app
- 访问站点
/ 根目录
app.js 程序入口
package.json 站点信息
README.md 说明文档
.gitignore git 忽略文件
config/ 配置
data/ 数据
func/ 公共方法
routes/ 接口路由
fe/ 展示路由