企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持知识库和私有化部署方案 广告
# 小程序配置 1、执行update.sql 文件里面的sql语句时,切记不要导入,复制sql到数据库执行,后台清理缓存 [![](http://help.niushop.com.cn/assets/小程序清除缓存.png)](http://help.niushop.com.cn/assets/小程序清除缓存.png) 2、打开微信小程序管理平台 (1)配置小程序服务域名、获取小程序ID和密钥 [![](http://help.niushop.com.cn/assets/小程序后台配置.png)](http://help.niushop.com.cn/assets/小程序后台配置.png) [![](http://help.niushop.com.cn/assets/配置小程序及获取ID密钥.png)](http://help.niushop.com.cn/assets/配置小程序及获取ID密钥.png) (2)小程序request 合法域名中需额外添加 pv.sohu.com (用于获取登录用户IP,购买商品下单时会用到IP参数) 3、配置小程序源码 (1)打开微信开发者工具(官网下载即可,根据系统下载) [![](http://help.niushop.com.cn/assets/下载微信开发者工具.png)](http://help.niushop.com.cn/assets/下载微信开发者工具.png) [![](http://help.niushop.com.cn/assets/图标.png)](http://help.niushop.com.cn/assets/图标.png) (2)打开开发者工具新建小程序项目,目录需要自己创建一个文件夹 [![](http://help.niushop.com.cn/assets/创建小程序项目.png)](http://help.niushop.com.cn/assets/创建小程序项目.png) [![](http://help.niushop.com.cn/assets/创建小程序目录(2).png)](http://help.niushop.com.cn/assets/创建小程序目录(2).png) (3)找到刚才创建的目录文件夹把小程序源码粘贴覆盖进去 (4)打开小程序代码修改api.js里面的url(url必须是https的,url 必须以斜杠 ’/’ 结尾)。关于https必须配置SSL 证书,可以使用宝塔等SSL证书。 [![](http://help.niushop.com.cn/assets/修改api_js里面的路径.png)](http://help.niushop.com.cn/assets/修改api_js里面的路径.png) 例:宝塔证书配置(选择其中一种即可) [![](http://help.niushop.com.cn/assets/宝塔SSL.png)](http://help.niushop.com.cn/assets/宝塔SSL.png) [![](http://help.niushop.com.cn/assets/Encrypt.png)](http://help.niushop.com.cn/assets/Encrypt.png) (5)如果后台已开启API安全,请修改此参数为您后台填写的秘钥,如未开启,请保持为空 [![](http://help.niushop.com.cn/assets/API密钥.png)](http://help.niushop.com.cn/assets/API密钥.png) 4、配置小程序支付 [![](http://help.niushop.com.cn/assets/小程序支付配置.png)](http://help.niushop.com.cn/assets/小程序支付配置.png) [![](http://help.niushop.com.cn/assets/小程序平台.png)](http://help.niushop.com.cn/assets/小程序平台.png) (1)如果同时使用微信公众号的微信支付,公众号与小程序需配置同一个商户号 (2)如果不使用公众号,微信支付appid与APPSecrect使用小程序的即可 5、上传真实商品数据(不要使用过于虚假的测试数据,否则审核无法通过)、上传小程序 [![](http://help.niushop.com.cn/assets/上传小程序.png)](http://help.niushop.com.cn/assets/上传小程序.png) 6、发布小程序 (1)提交审核,等待审核通过后发布。 [![](http://help.niushop.com.cn/assets/发布.png)](http://help.niushop.com.cn/assets/发布.png) * * * 如果已配置request安全域名,仍遇到此类问题 [![](http://help.niushop.com.cn/assets/安全域名.png)](http://help.niushop.com.cn/assets/安全域名.png) 点开域名信息页,然后点击编译/刷新,即可解决 [![](http://help.niushop.com.cn/assets/解决安全域名错误.png)](http://help.niushop.com.cn/assets/解决安全域名错误.png)