request->openAuthInfo(); $service = new JwtTokenService(); $valid_exp = intval(Config::get('admin.openapi_token_valid_exp', 15)); $exp = strtotime("+ {$valid_exp}hour"); $token = $service->createToken($auth->id, 'openapi', $exp); Cache::store('file')->set('openapi_' . $token['token'], time() + $token['out'], $token['out']); return app('json')->success(['token' => $token['token'],'exp' => $token['out']]); } }