$msg, 'url' => $url, 'wait' => $wait, ]; $html = view('/public/jump', $result); throw new \think\exception\HttpResponseException($html); } function ajax_success($data) { $res = ['code' => 0, 'msg' => '成功', 'data' => $data]; $response = \think\Response::create($res, 'json'); throw new \think\exception\HttpResponseException($response); } function get_user_id() { $sessionUserId = session('mobile.user.id'); if (empty($sessionUserId)) { session('back_url',request()->url()); $response = redirect('/mobile/login/login'); throw new \think\exception\HttpResponseException($response); } return $sessionUserId; } function get_soldier() { $id = session('mobile.soldier.id'); if (empty($id)) { $response = redirect('/mobile/soldier/login'); throw new \think\exception\HttpResponseException($response); } $soldier = \app\common\model\SoldierModel::find($id); return $soldier; }