Commit 9ad2c06e by 庄欣

fix bug

parent df8d17b0
...@@ -20,7 +20,7 @@ class ControllerBase ...@@ -20,7 +20,7 @@ class ControllerBase
{ {
public function getAuth() public function getAuth()
{ {
return request("uuid",12); return request("uuid",3);
static $id; static $id;
if (!$id) { if (!$id) {
$code = request()->header("token"); $code = request()->header("token");
......
...@@ -7,6 +7,7 @@ use App\Exceptions\ApiUnauthorized; ...@@ -7,6 +7,7 @@ use App\Exceptions\ApiUnauthorized;
use App\Http\Controllers\ControllerBase; use App\Http\Controllers\ControllerBase;
use Illuminate\Routing\Controller; use Illuminate\Routing\Controller;
use App\Lib\Response\Response; use App\Lib\Response\Response;
use Illuminate\Http\Request;
class Sets extends ControllerBase class Sets extends ControllerBase
{ {
...@@ -17,6 +18,9 @@ class Sets extends ControllerBase ...@@ -17,6 +18,9 @@ class Sets extends ControllerBase
const TIME_IN = 1; const TIME_IN = 1;
const TIME_AFTER = 2; const TIME_AFTER = 2;
const SETS_TYPE_NORMAL = 0;
const SETS_TYPE_TRAVEL = 1;
protected function after_hook($res) protected function after_hook($res)
{ {
$path = app_path("Lib")."/underscore.php"; $path = app_path("Lib")."/underscore.php";
...@@ -61,5 +65,23 @@ class Sets extends ControllerBase ...@@ -61,5 +65,23 @@ class Sets extends ControllerBase
} }
} }
/**
* 保存
*/
public function store(Request $request)
{
$data = $request->all();
if ($data['type'] == self::SETS_TYPE_NORMAL) {
$request->merge([
'abroad' => 0 //非旅拍套系则视作国内
]);
} else {
$request->merge([
'abroad' => $data['abroad'] // 旅拍套系按照传入的值来
]);
}
return parent::store($request);
}
} }
\ No newline at end of file
...@@ -116,7 +116,7 @@ class CurlClient ...@@ -116,7 +116,7 @@ class CurlClient
$curlinfo = curl_getinfo($http); $curlinfo = curl_getinfo($http);
} }
if ($curlinfo == false || (is_array($curlinfo) && $curlinfo['http_code'] != 200)) { if ($curlinfo == false || (is_array($curlinfo) && $curlinfo['http_code'] != 200)) {
var_dump($curlinfo); var_dump($res);
throw new \Exception("返回错误"); throw new \Exception("返回错误");
} }
$res = json_decode($res); $res = json_decode($res);
......
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