Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Tokumeikoi 2020-11-19 21:21:39 +08:00
commit baf719fcff
2 changed files with 19 additions and 6 deletions

View File

@ -45,12 +45,11 @@ class PoseidonController extends Controller
$user->v2ray_user = [
"uuid" => $user->uuid,
"email" => sprintf("%s@v2board.user", $user->uuid),
"alter_id" => $user->v2ray_alter_id,
"level" => $user->v2ray_level,
"alter_id" => $server->alter_id,
"level" => 0,
];
unset($user['uuid']);
unset($user['v2ray_alter_id']);
unset($user['v2ray_level']);
unset($user['email']);
array_push($result, $user);
}
@ -136,9 +135,23 @@ class PoseidonController extends Controller
}
protected function success($data) {
$req = request();
// Only for "GET" method
if (!$req->isMethod('GET') || !$data) {
return response([
'msg' => 'ok',
'data' => $data,
]);
}
$etag = sha1(json_encode($data));
if ($etag == $req->header("IF-NONE-MATCH")) {
return response(null, 304);
}
return response([
'msg' => 'ok',
'data' => $data,
]);
])->header('ETAG', $etag);
}
}

View File

@ -17,7 +17,7 @@ class OrderAssign extends FormRequest
'plan_id' => 'required',
'email' => 'required',
'total_amount' => 'required',
'cycle' => 'required|in:month_price,quarter_price,half_year_price,year_price,onetime_price,reset_price'
'cycle' => 'required|in:month_price,quarter_price,half_year_price,year_price,two_year_price,three_year_price,onetime_price,reset_price'
];
}