input('package', ''); $send_order_id = $request->input('send_order_id', 0); $device_no = $request->input('device_no', ''); $androidid = $request->input('androidid', ''); $imei = $request->input('imei', ''); $mac = $request->input('mac', ''); $device_info = $request->input('device_info', ''); if ($device_no) { $data = (new QappUserService)->login(compact('package', 'send_order_id', 'device_no', 'androidid', 'mac', 'device_info', 'imei')); return response()->success($data); } else { return response()->error('PARAM_ERROR'); } } /** * @apiVersion 1.0.0 * @apiDescription 刷新token * @api {get} refreshToken 刷新token * @apiParam {String} [token] token * @apiHeader {String} [Authorization] token 两个token任选其一 * @apiGroup Login * @apiName RefreshToken * @apiSuccess {int} code 状态码 * @apiSuccess {String} msg 信息 * @apiSuccess {object} data 结果集 * @apiSuccess {String} data.token token * @apiSuccess {Int} data.time 过期时间 * @apiSuccessExample {json} Success-Response: * HTTP/1.1 200 OK * { * code: 0, * msg: "", * data: { * token:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, * time:123455 * } * } */ public function refreshToken() { try { $old_token = JWTAuth::getToken(); $token = JWTAuth::refresh($old_token); $time = strtotime("+1 month"); return response()->success(compact('token', 'time')); } catch (JWTException $e) { return response()->error('QAPP_NOT_LOGIN'); } } }