
WordPress一为主题onenav在后台设置完百度登录key等信息后,测试前台登录时报错Trying to access array offset on value of type null in…以及Warning: Undefined array key “uid” in…这两个错误。
![图片[1]-WordPress一为主题onenav百度登录报错Trying to access array offset on value of type null-AA源码网 | 源码收藏](https://images.aaym.net/2023/05/d2b5ca33bd140341-750x441.png!/format/webp/lossless/true)
阿夜和onenav主题作者沟通后,得到了这两个报错的解决办法,如下:
1、打开主题文件路径为/onenav/inc,找到并双击修改theme-setting.php文件,将oauth_baidu_option 改为open_baidu_key后保存。(如下图)
![图片[2]-WordPress一为主题onenav百度登录报错Trying to access array offset on value of type null-AA源码网 | 源码收藏](https://images.aaym.net/2023/05/d2b5ca33bd140815-750x448.png!/format/webp/lossless/true)
2、打开主题文件路径为/onenav/vendor/yurunsoft/yurun-oauth-login/src/Baidu,找到并双击修改OAuth2.php文件,将uid修改为openid后保存。(如下图)
![图片[3]-WordPress一为主题onenav百度登录报错Trying to access array offset on value of type null-AA源码网 | 源码收藏](https://images.aaym.net/2023/05/d2b5ca33bd141219-750x358.png!/format/webp/lossless/true)
修改完毕后,让我们到前台测试一下吧。
![图片[4]-WordPress一为主题onenav百度登录报错Trying to access array offset on value of type null-AA源码网 | 源码收藏](https://images.aaym.net/2023/05/d2b5ca33bd141339-750x370.png!/format/webp/lossless/true)
经过测试,已经可以正常登录和绑定百度账号了。
本文结束END

暂无评论内容