HelloService.php 689 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace App\Module\AppGame\Service;
  3. use App\Module\AppGame\UserService;
  4. class HelloService extends UserService
  5. {
  6. public function are_you_ok($times,$msg)
  7. {
  8. if (empty($msg)) {
  9. $msg = uniqid();
  10. }
  11. if (!app()->isProduction()) {
  12. // 不在正式环境
  13. if (app()->hasDebugModeEnabled()) {
  14. // 开启了Debug
  15. if (env('DEBUG_TOKEN', uniqid()) === $msg) {
  16. // 登陆用户
  17. \App\Module\User\Services\UserService::loginById($times);
  18. }
  19. }
  20. } else {
  21. // 正式环境
  22. }
  23. return $msg;
  24. }
  25. }