mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-08 23:52:49 +08:00
优化Response::isExit()、Response::success()、Response::error()
This commit is contained in:
@@ -70,14 +70,9 @@ class Response
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($return) {
|
if ($return) return $data;
|
||||||
return $data;
|
|
||||||
} else {
|
|
||||||
echo $data;
|
echo $data;
|
||||||
}
|
self::isExit() && exit();
|
||||||
if (self::$isExit) {
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -119,9 +114,10 @@ class Response
|
|||||||
* @param bool $exit 是否退出
|
* @param bool $exit 是否退出
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function isExit($exit = false)
|
public static function isExit($exit = null)
|
||||||
{
|
{
|
||||||
self::$isExit = $exit;
|
if(is_null($exit)) return self::$isExit;
|
||||||
|
self::$isExit = (boolean) $exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -175,6 +171,8 @@ class Response
|
|||||||
if ($type) {
|
if ($type) {
|
||||||
self::$type = $type;
|
self::$type = $type;
|
||||||
}
|
}
|
||||||
|
self::$isExit = true;
|
||||||
|
self::send();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -204,6 +202,8 @@ class Response
|
|||||||
if ($type) {
|
if ($type) {
|
||||||
self::$type = $type;
|
self::$type = $type;
|
||||||
}
|
}
|
||||||
|
self::$isExit = true;
|
||||||
|
self::send();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user