post()->goCheck('add'); $result = UserVisitLogic::add($params,$this->userId); if (true === $result) { return $this->success('ok'); } return $this->fail(UserVisitLogic::getError()); } // #[ // ApiDoc\Title('用户访问页面记录'), // ApiDoc\url('/api/user/UserVisit/htmlLog'), // ApiDoc\Method('POST'), // ApiDoc\Param(name: "url", type: "string", require: true, desc: "路径"), // ApiDoc\Param(name: "stay_time", type: "int", require: true, desc: "停留时间"), // ApiDoc\NotHeaders(), // ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"), // ApiDoc\ResponseSuccess("data", type: "array"), // ] public function htmlLog() { $ip = $this->request->getRealIp(); $params = (new VisitValidate())->post()->goCheck('userAdd'); $params['ip'] = $ip; $result = UserVisitLogic::visitAdd($params,$this->userInfo); if (true === $result) { return $this->success('添加成功', [], 1, 1); } return $this->fail(UserVisitLogic::getError()); } }