1234567891011121314151617181920212223242526 |
- <?php
- // 应用公共文件
- function jump($msg = '', $url = null, $wait = 3)
- {
- if (is_null($url)) {
- $url = 'javascript:history.back(-1);';
- } else {
- $url = "location.href = '" . url($url) . "'";
- }
- $result = [
- 'msg' => $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);
- }
|