repository = $authRepositoryEloquent; } /** * * @param Request $request * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator|\Illuminate\Support\Collection|mixed * @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException * @throws \Prettus\Validator\Exceptions\ValidatorException */ public function handleCodeToAuth($appid, $openID, $type = 0) { $auth = Auth::query()->where([ 'identifier' => $appid, 'type' => $type, 'credential' => $openID, ])->first(); if ($auth) { return $auth; } $auth = $this->repository->create([ 'identifier' => $appid, 'type' => $type, 'credential' => $openID, 'user_id' => 0, 'status' => ModelStatusEnum::OK, ]); return $auth; } /** * 刷新token * @return mixed|object */ public function handleRefreshToken() { $token = auth()->refresh(); return $token; } }