$this->phone ??'', 'nick_name' => $this->nick_name ??'', 'avatar' => $this->avatar ? (Str::startsWith($this->avatar, 'http') ? $this->avatar:env('OSS_URL').$this->avatar):'', 'points' => $this->points ??0, 'draw_num' => $this->draw_num ??0, 'lv' => $this->rankLv(), // 在登录的时候才返回 api_token, 和api过期时间 'api_token' => $this->when($this->api_token, $this->api_token), 'expire_in' => $this->when($this->api_token, Carbon::parse()->addSeconds(auth('api')->factory()->getTTL() * 60)->toDateTimeString()) ]; } public function with($request) { return ['code' => Response::HTTP_OK, 'message' => '']; } }