#0 [0]TypeError in User.php line 53

Argument 1 passed to app\common\service\User::login() must be of the type string, null given

  1. return $user;
  2. }
  3. /**
  4. * 登录校验
  5. * @param string $username 用户名或邮箱
  6. * @param string $password 密码
  7. * @return array
  8. */
  9. public function login(string $username, string $password)
  10. {
  11. $user = \app\common\model\Users::where('email|userName',$username)
  12. ->where('password',md5($password))
  13. ->find();
  14. if (empty($user)) {
  15. return [
  16. 'error' => 1,
  17. 'msg' => 'Username or password is error!',
  18. ];

Call Stack

  1. in User.php line 53
  2. at User->login()
  3. at call_user_func_array() in Facade.php line 96
  4. at Facade::__callStatic() in Index.php line 84
  5. at Index->login()
  6. at ReflectionMethod->invokeArgs() in Container.php line 342
  7. at Container->invokeReflectMethod() in Controller.php line 110
  8. at Controller->think\route\dispatch\{closure}() in Pipeline.php line 59
  9. at Pipeline->think\{closure}() in Pipeline.php line 65
  10. at Pipeline->then() in Controller.php line 113
  11. at Controller->exec() in Dispatch.php line 89
  12. at Dispatch->run() in Route.php line 760
  13. at Route->think\{closure}() in Pipeline.php line 59
  14. at Pipeline->think\{closure}() in Pipeline.php line 65
  15. at Pipeline->then() in Route.php line 761
  16. at Route->dispatch() in Http.php line 210
  17. at Http->dispatchToRoute() in Http.php line 200
  18. at Http->think\{closure}() in Pipeline.php line 59
  19. at Pipeline->think\{closure}() in MultiApp.php line 71
  20. at MultiApp->think\app\{closure}() in Pipeline.php line 59
  21. at Pipeline->think\{closure}() in Pipeline.php line 65
  22. at Pipeline->then() in MultiApp.php line 72
  23. at MultiApp->handle()
  24. at call_user_func() in Middleware.php line 142
  25. at Middleware->think\{closure}() in Pipeline.php line 84
  26. at Pipeline->think\{closure}() in SessionInit.php line 67
  27. at SessionInit->handle()
  28. at call_user_func() in Middleware.php line 142
  29. at Middleware->think\{closure}() in Pipeline.php line 84
  30. at Pipeline->think\{closure}() in TraceDebug.php line 71
  31. at TraceDebug->handle()
  32. at call_user_func() in Middleware.php line 142
  33. at Middleware->think\{closure}() in Pipeline.php line 84
  34. at Pipeline->think\{closure}() in Pipeline.php line 65
  35. at Pipeline->then() in Http.php line 201
  36. at Http->runWithRequest() in Http.php line 162
  37. at Http->run() in index.php line 25

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER www
HOME /home/www
SCRIPT_NAME /index.php
REQUEST_URI /index/index/login/
QUERY_STRING
REQUEST_METHOD GET
SERVER_PROTOCOL HTTP/2.0
GATEWAY_INTERFACE CGI/1.1
REDIRECT_URL /index/index/login/
REMOTE_PORT 51978
SCRIPT_FILENAME /www/wwwroot/45.33.14.229/public/index.php
SERVER_ADMIN webmasterexample.com
CONTEXT_DOCUMENT_ROOT /www/wwwroot/45.33.14.229/public
CONTEXT_PREFIX
REQUEST_SCHEME https
DOCUMENT_ROOT /www/wwwroot/45.33.14.229/public
REMOTE_ADDR 44.222.116.199
SERVER_PORT 443
SERVER_ADDR 45.33.14.229
SERVER_NAME www.isenvo.com
SERVER_SOFTWARE Apache
SERVER_SIGNATURE <address>Apache Server at www.isenvo.com Port 443</address>
LD_LIBRARY_PATH /www/server/apache/lib
PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
HTTP_HOST www.isenvo.com
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
proxy-nokeepalive 1
H2_STREAM_TAG 1-3
H2_STREAM_ID 3
H2_PUSHED_ON
H2_PUSHED
H2_PUSH off
H2PUSH off
HTTP2 on
SSL_TLS_SNI www.isenvo.com
HTTPS on
REDIRECT_STATUS 200
REDIRECT_H2_STREAM_TAG 1-3
REDIRECT_H2_STREAM_ID 3
REDIRECT_H2_PUSHED_ON
REDIRECT_H2_PUSHED
REDIRECT_H2_PUSH off
REDIRECT_H2PUSH off
REDIRECT_HTTP2 on
REDIRECT_SSL_TLS_SNI www.isenvo.com
REDIRECT_HTTPS on
REDIRECT_PATH_INFO index/index/login/
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1711665001.1074
REQUEST_TIME 1711665001
0.060318s