Commit 47b41a12 authored by clone's avatar clone

bug

parent f275a0ab
...@@ -71,7 +71,7 @@ class AppointmentTime extends Basic ...@@ -71,7 +71,7 @@ class AppointmentTime extends Basic
return $this->response("101", "楼盘信息不能为空"); return $this->response("101", "楼盘信息不能为空");
} }
//todo 参数校验 //todo 参数校验
if (!isset($params["phone"]) || !preg_match('/^1[345678]\d{9}$/', $params["phone"])) { if (!isset($params["phone"]) || !preg_match('/^1[3456789]\d{9}$/', $params["phone"])) {
return $this->response("101", "手机号为空或手机号无效"); return $this->response("101", "手机号为空或手机号无效");
} }
......
...@@ -41,8 +41,8 @@ class Response ...@@ -41,8 +41,8 @@ class Response
/** /**
* 构造函数 * 构造函数
* @access public * @access public
* @param mixed $data 输出数据 * @param mixed $data 输出数据
* @param int $code * @param int $code
* @param array $header * @param array $header
* @param array $options 输出参数 * @param array $options 输出参数
*/ */
...@@ -60,11 +60,11 @@ class Response ...@@ -60,11 +60,11 @@ class Response
/** /**
* 创建Response对象 * 创建Response对象
* @access public * @access public
* @param mixed $data 输出数据 * @param mixed $data 输出数据
* @param string $type 输出类型 * @param string $type 输出类型
* @param int $code * @param int $code
* @param array $header * @param array $header
* @param array $options 输出参数 * @param array $options 输出参数
* @return Response|JsonResponse|ViewResponse|XmlResponse|RedirectResponse|JsonpResponse * @return Response|JsonResponse|ViewResponse|XmlResponse|RedirectResponse|JsonpResponse
*/ */
public static function create($data = '', $type = '', $code = 200, array $header = [], $options = []) public static function create($data = '', $type = '', $code = 200, array $header = [], $options = [])
...@@ -106,7 +106,7 @@ class Response ...@@ -106,7 +106,7 @@ class Response
$this->header['Cache-Control'] = 'max-age=' . $cache[1] . ',must-revalidate'; $this->header['Cache-Control'] = 'max-age=' . $cache[1] . ',must-revalidate';
$this->header['Last-Modified'] = gmdate('D, d M Y H:i:s') . ' GMT'; $this->header['Last-Modified'] = gmdate('D, d M Y H:i:s') . ' GMT';
$this->header['Expires'] = gmdate('D, d M Y H:i:s', $_SERVER['REQUEST_TIME'] + $cache[1]) . ' GMT'; $this->header['Expires'] = gmdate('D, d M Y H:i:s', $_SERVER['REQUEST_TIME'] + $cache[1]) . ' GMT';
Cache::tag($cache[2])->set($cache[0], [$data, $this->header], $cache[1]); Cache::tag($cache[2])->set($cache[0], [ $data, $this->header ], $cache[1]);
} }
} }
...@@ -177,8 +177,8 @@ class Response ...@@ -177,8 +177,8 @@ class Response
/** /**
* 设置响应头 * 设置响应头
* @access public * @access public
* @param string|array $name 参数名 * @param string|array $name 参数名
* @param string $value 参数值 * @param string $value 参数值
* @return $this * @return $this
*/ */
public function header($name, $value = null) public function header($name, $value = null)
...@@ -199,14 +199,14 @@ class Response ...@@ -199,14 +199,14 @@ class Response
public function content($content) public function content($content)
{ {
if (null !== $content && !is_string($content) && !is_numeric($content) && !is_callable([ if (null !== $content && !is_string($content) && !is_numeric($content) && !is_callable([
$content, $content,
'__toString', '__toString',
]) ])
) { ) {
throw new \InvalidArgumentException(sprintf('variable type error: %s', gettype($content))); throw new \InvalidArgumentException(sprintf('variable type error: %s', gettype($content)));
} }
$this->content = (string) $content; $this->content = (string)$content;
return $this; return $this;
} }
...@@ -269,7 +269,7 @@ class Response ...@@ -269,7 +269,7 @@ class Response
/** /**
* 页面输出类型 * 页面输出类型
* @param string $contentType 输出类型 * @param string $contentType 输出类型
* @param string $charset 输出编码 * @param string $charset 输出编码
* @return $this * @return $this
*/ */
public function contentType($contentType, $charset = 'utf-8') public function contentType($contentType, $charset = 'utf-8')
...@@ -309,16 +309,16 @@ class Response ...@@ -309,16 +309,16 @@ class Response
{ {
if (null == $this->content) { if (null == $this->content) {
$content = $this->output($this->data); $content = $this->output($this->data);
Log::record("response msg:" . $content);
if (null !== $content && !is_string($content) && !is_numeric($content) && !is_callable([ if (null !== $content && !is_string($content) && !is_numeric($content) && !is_callable([
$content, $content,
'__toString', '__toString',
]) ])
) { ) {
throw new \InvalidArgumentException(sprintf('variable type error: %s', gettype($content))); throw new \InvalidArgumentException(sprintf('variable type error: %s', gettype($content)));
} }
$this->content = (string) $content; $this->content = (string)$content;
} }
return $this->content; return $this->content;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment