Skip to content

微信第三方开发平台(使用 Node.js) Wechat Third-party Platform (Using Node.js)

Notifications You must be signed in to change notification settings

vinzid/wechat-third

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

安装

  1. 安装软件

Git
Node
Nginx
mongoDB

  1. 拉取代码

git clone https://github.com/vinzid/wechat-third.git && cd wechat-third

  1. 安装依赖

npm i --no-save

  1. 启动 mongoDB

"C:/Program Files/MongoDB/Server/3.6/bin/mongod.exe"

  1. 添加初始数据

"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 }
    ])
  1. 添加配置文件(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"
    }
}
  1. 运行 Node.js服务

node app

  1. 访问站点

http://localhost:9031/

目录结构

/  根目录  
app.js  程序入口  
package.json  站点信息  
README.md  说明文档  
.gitignore  git 忽略文件  

config/  配置  

data/  数据  

func/ 公共方法  

routes/  接口路由  

fe/  展示路由  

About

微信第三方开发平台(使用 Node.js) Wechat Third-party Platform (Using Node.js)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published