webman-socialite使用的时候,weibo的WeiboProvider报错

sparks

问题描述

使用weibo的时候,出现错误 ,是我使用的方式不对么?

程序代码

    public function weibo(Request $request)
    {
        $redirect = Socialite::driver('weibo')->redirect();
        return redirect($redirect);
    }

报错信息

Error: Undefined constant "Shopwwi\WebmanSocialite\Contracts\SHOPWWI_SOC_EMAIL" in D:\worker\kxapi\vendor\shopwwi\webman-socialite\src\SocialiteManager.php:87
Stack trace:
#0 D:\worker\kxapi\vendor\shopwwi\webman-socialite\src\SocialiteManager.php(111): Shopwwi\WebmanSocialite\SocialiteManager->buildProvider()
#1 D:\worker\kxapi\vendor\shopwwi\webman-socialite\src\SocialiteManager.php(53): Shopwwi\WebmanSocialite\SocialiteManager->createDriverProvider()
#2 D:\worker\kxapi\vendor\shopwwi\webman-socialite\src\Facade\Socialite.php(60): Shopwwi\WebmanSocialite\SocialiteManager->driver()
#3 D:\worker\kxapi\app\controller\AuthController.php(46): Shopwwi\WebmanSocialite\Facade\Socialite::__callStatic()
#4 D:\worker\kxapi\vendor\workerman\webman-framework\src\App.php(318): app\controller\AuthController->weibo()
#5 D:\worker\kxapi\vendor\workerman\webman-framework\src\App.php(348): Webman\App::Webman\{closure}()
#6 D:\worker\kxapi\app\middleware\GlobalInfo.php(19): Webman\App::Webman\{closure}()
#7 D:\worker\kxapi\vendor\workerman\webman-framework\src\App.php(340): app\middleware\GlobalInfo->process()
#8 D:\worker\kxapi\vendor\workerman\webman-framework\src\App.php(141): Webman\App::Webman\{closure}()
#9 D:\worker\kxapi\vendor\workerman\workerman\Connection\TcpConnection.php(646): Webman\App->onMessage()
#10 D:\worker\kxapi\vendor\workerman\workerman\Events\Select.php(311): Workerman\Connection\TcpConnection->baseRead()
#11 D:\worker\kxapi\vendor\workerman\workerman\Worker.php(2470): Workerman\Events\Select->loop()
#12 D:\worker\kxapi\vendor\workerman\workerman\Worker.php(1453): Workerman\Worker->run()
#13 D:\worker\kxapi\vendor\workerman\workerman\Worker.php(1396): Workerman\Worker::forkWorkersForWindows()
#14 D:\worker\kxapi\vendor\workerman\workerman\Worker.php(560): Workerman\Worker::forkWorkers()
#15 D:\worker\kxapi\vendor\workerman\webman-framework\src\support\App.php(131): Workerman\Worker::runAll()
#16 D:\worker\kxapi\start.php(4): support\App::run()
#17 {main}

截图报错信息里报错文件相关代码

截图
截图

操作系统及workerman/webman等框架组件具体版本

这里写具体的系统环境相关信息
"php": ">=7.2",
"workerman/webman-framework": "^1.5.0",
"monolog/monolog": "^2.0",
"shopwwi/webman-socialite": "^1.0",
"workerman/http-client": "^2.0",
"webman-tech/laravel-http-client": "^1.1",
"webman/blade": "^1.5",
"psr/container": "1.1.1",
"illuminate/database": "^9.52",
"illuminate/pagination": "^9.52",
"illuminate/events": "^9.52",
"symfony/var-dumper": "^6.0"

718 1 0
1个回答

jediking

我感觉他的写法就有问题 我也遇到了

  • sparks 2023-04-09

    他用的是php8.1以上的版本,好像是,php8版本的const好像不支持这种写法,我之前是使用implements Shopwwi\WebmanSocialite\Contracts\User来引入报错的const,然后把几个需要重载的函数用空函数代替了来解决这个问题的,好像可以通过提高php的版本来实现

年代过于久远,无法发表回答
×
🔝