多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
## 微信小程序uniapp发行h5 配置小程序的前提是必须部署好SSL证书 商城后台微信小程序操作 ![](https://img.kancloud.cn/6c/23/6c236fde262855ec14057c584d6528d2_1770x845.png) 下面填写信息需要在微信小程序中找 ![](https://img.kancloud.cn/67/db/67db5a7d15cf819c7403f957638b1489_1868x828.png) 登录微信小程序--找到菜单设置 ![](https://img.kancloud.cn/64/cc/64cce6b6c573e4231c9877e47db44315_1858x692.png) ![](https://img.kancloud.cn/39/6b/396b7f82949d96d2d996ac3b3ffbf71f_1893x776.png) 微信小程序的APPID和APP密钥 ![](https://img.kancloud.cn/79/12/7912d64a2f05db97b44ed3a055568d60_1572x816.png) 将后台的合法域名填写到微信小程序中合法域名那 ![](https://img.kancloud.cn/87/3a/873aacabc23586a3a39e9860a9984b0b_1783x825.png) ![](https://img.kancloud.cn/05/e7/05e70bb5522556a472902733f50873b5_1736x859.png) 填写完以上之后下载小程序源码 ![](https://img.kancloud.cn/00/1b/001b8c2138005b76b9d493a449c68d32_1827x741.png) ![](https://img.kancloud.cn/62/c5/62c50e9a4a5e8c802c6056300cfe1f81_1866x797.png) 下载完小程序源码之后需要把源码导入到hbuilder中,下载hbuilder(\[[https://www.dcloud.io/hbuilderx.html](https://www.dcloud.io/hbuilderx.html)\]) ![](https://img.kancloud.cn/70/dd/70dd28f47058b923b194d4dc1a38ab66_1534x811.png) ![](https://img.kancloud.cn/ef/aa/efaa687481f36daf357144931f934f44_1505x820.png) ![](https://img.kancloud.cn/8a/66/8a667c4c41fc03e9d22cec6cc898a203_1148x857.png) 修改文件的api路径 ![](https://img.kancloud.cn/31/af/31af494bcdd1dd6308539a1536899e24_1561x842.png) 安装一个运行插件 ![](https://img.kancloud.cn/f1/fb/f1fb3e360fcd9f6ed07b369af353c24a_1842x732.png) ![](https://img.kancloud.cn/ee/20/ee203b05bd955056da6f59a3fd8145b5_832x872.png) 发行h5 ![](https://img.kancloud.cn/28/05/28055d3d8266158e8c80a95c80e68bbd_1265x855.png) ![](https://img.kancloud.cn/7a/1f/7a1f00ebe931cd5ab53aff148eb7fb67_1583x807.png) ![](https://img.kancloud.cn/aa/dd/aadd66250990cf2a95c991b68eba4a32_1377x855.png) 打开static文件 ![](https://img.kancloud.cn/e4/32/e432cd61821e247d37d9227ee76a43f2_773x272.png) 打开js文件 ![](https://img.kancloud.cn/58/2f/582fcc92db2aa6924880a8223ac60b0c_938x276.png) 找到index.b8fd23ff.js文件 用HBuilder X打开 ![](https://img.kancloud.cn/4f/9e/4f9e322a9c1744b6021e3a352b6d9bc2_1910x939.png) 打开是这样的 ctrl+k格式化一下 ![](https://img.kancloud.cn/50/05/5005108cb93063191b4151d555e8c15b_1712x727.png) 然后ctrl+f 字符搜索 搜索baseurl 找到下图框选的地方 ![](https://img.kancloud.cn/0e/9d/0e9d828c15a1de9419cb6075d37b06df_1303x715.png) 改完之后 ![](https://img.kancloud.cn/3d/cd/3dcde5ab883528588e52464faf7c19c8_1609x782.png) 然后再搜索 :e.\_\_uniConfig.router 找到下图框选的地方 ![](https://img.kancloud.cn/f6/98/f69882acf0dc0dde70b86e7cff5c4e11_1573x885.png) 把base:"/" 替换成 base: "/h5/s"+ m\[1\] +"/" ![](https://img.kancloud.cn/86/89/8689cc062dd1eaa093366f2cc9bd1e33_1339x697.png) 然后再搜索dc2c 找到下图框选的地方 ![](https://img.kancloud.cn/4e/10/4e10c4a7d26db9cb81b1af883aec67f0_1429x888.png) 在下一行加上 m \= location.href.match(/\\/s(\\d\*)\\//); 再在下一行加上 if (!m) throw 'Illegal request'; ![](https://img.kancloud.cn/0a/d6/0ad6a56694a0660946da37a6054dc2ab_1547x729.png) 然后把文件保存 ctrl+s 文件压缩,压缩完把压缩包上传到商城源码 ![](https://img.kancloud.cn/6c/1e/6c1e1ce7a260ed1b553214a7017def0b_1852x794.png)