安装完毕系统后,需要将我们的系统配置好,小程序配置好域名,方可使用,域名切记要是https://。
步骤一:先申请一个小程序帐号,并进入到开发者配置,生成appid和secret,配置我们安装好的系统域名。

这里姑且拿测试号进行演示,申请到的小程序比这个要全,配置的地方在开发选项中。
步骤二:配置好我们的可信域名。

步骤二:回到系统,将我们申请好的参数进行配置

步骤四:回到微信开发者工具测试下,修改小程序的配置,config.js下修改域名。

步骤五:修改文件project.config.json ,下的小程序appid,为自己的。

end:完成配置,刷新检查是否无误
报错1:login 接口 提示如下信息

问题原因:缓存的配置信息参数为空,code程序端未获取到。
1.1缓存的配置信息参数为空
排查方式:检查我们的数据配置是否配置准确,同时进入;app\Http\Services\WechatServices.php‘文件中,打印我们的小程序配置是否为空。

回到微信开发者工具,打开检查login返回的信息。


显示数组中参数为空,这里是因为缓存的缘故,如果系统配置已经配置有参数,我们将如下参数进行修改。

注释掉,打印再次尝试看看。
1.2小程序的code参数程序端未获取到

这里的问题就是,我们的project.config.json 文件中的appid没有配置正确,检查域名是否开启了https,如果没有开启,http时是没有code参数进行提交的。
网友评论