# fastWXCode **Repository Path**: Z2105873459/fast-wxcode ## Basic Information - **Project Name**: fastWXCode - **Description**: 快速上传微信代码 - **Primary Language**: NodeJS - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-06-18 - **Last Updated**: 2021-08-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # upload_wx_code 微信小程序代码自动上传 使用:npm install upload_wx_code ```js const uploadCode = require('upload_wx_code'); const parmas = { keyFileListPath:'D:/xxx/xxx', buildFileListPath:'D:/xxx/xxx' } const reslute = uploadCode(parmas);//node xxx.js 执行 console.log(reslute,'返回上传结果') ``` ## 参数详细介绍 | 字段 |是否必传|参数示例|说明| | --- | --- | --- | --- | | keyFileListPath| 是 |D:/xxx/xxx |代码上传秘钥文件 | buildFileListPath| 是 |D:/xxx/xxx | 已打包好wx代码 **keyFileListPath**:下载好的微信小程序代码上传秘钥**绝对路径** - 代码上传秘钥文件在那里? 微信公众平台 > 登录小程序 > 开发管理 > 开发设置 > 小程序代码上传栏目 > 生成秘钥 > 下载 - 除了代码上传秘钥之外还需要什么么? 关闭你的代码上传白名单设置 微信公众平台 > 登录小程序 > 开发管理 >开发设置 > 小程序代码上传栏目 > 把白名单按钮从绿色变成灰色。 - 注意事项 必须保证 参数里提供的代码上传秘钥在绝对路径里面 **buildFileListPath**:已打包好wx代码的**绝对路径** - 具体的绝对路径 通常来说,一个wx小程序的包打出来的话 在 dist/build/mp-weixin下是最后打包的内容,而我们在取绝对路径参数的时候,需要把mp-weixin去掉,就可以赋值给buildFileListPath 例如:D:/xxx/xxx/dist/build/mp-weixin >> D:/xxx/xxx/dist/build - 主要事项 包内使用的appid必须和上传秘钥文件**一致**,否则无法上传;