12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <?php
- namespace App\Console\Commands;
- use App\Models\AuthorizeCorp;
- use App\RedisModel;
- use App\Service\AccessTokenService;
- use App\Service\TokenService;
- use App\Log;
- use Illuminate\Console\Command;
- class AccessTokenDsUpdate extends Command
- {
- /**
- * The name and signature of the console command.
- *
- * @var string
- */
- protected $signature = 'AccessTokenDsUpdate';
- /**
- * The console command description.
- *
- * @var string
- */
- protected $description = '每3分钟监测需要更新的抖音小程序accesstoken';
- public function handle()
- {
- \DB::connection()->disableQueryLog();
- $this->info(date('m-d H:i:s') . ' 开始整理');
- $this->stat();
- $this->info(date('m-d H:i:s') . ' 整理结束');
- }
- public function stat()
- {
- $res = config('douyin.app_info');
- foreach($res as $appInfo){
- $accesstoken = AccessTokenService::getAccessToken($appInfo['app_id'], 'AccessTokenDsUpdate');
- $this->info(date('m-d H:i:s') . '小程序appid:'. $appInfo['app_id'] .' accesstoken:'. $accesstoken);
- }
- }
- }
|