|
|
@@ -41,7 +41,7 @@ class SortingController extends Controller
|
|
|
}
|
|
|
$station = SortingStation::findOrCreate($station_id);
|
|
|
$station->login();
|
|
|
- return ['result'=>'success','token'=>$user->token()];
|
|
|
+ return ['result'=>'success','token'=>$user->token(604800)];
|
|
|
}
|
|
|
|
|
|
protected function loginValidator(array $data)
|
|
|
@@ -62,6 +62,10 @@ class SortingController extends Controller
|
|
|
|
|
|
function process(Request $request){
|
|
|
$token = trim($request->input('token'));
|
|
|
+ if(!UserToken::getUser($token)){
|
|
|
+ return ['result'=>'unauthority','fail_info'=>'无效令牌或令牌过期'];
|
|
|
+ }
|
|
|
+
|
|
|
$station_id = $request->input('station_id');
|
|
|
$batch_id = $request->input('batch_id');
|
|
|
app('LogService')->log("浩创", "process", '分拨墙播种请求:'.json_encode($request->all()));
|
|
|
@@ -96,9 +100,6 @@ class SortingController extends Controller
|
|
|
app('LogService')->log(__METHOD__, 'error' . __FUNCTION__, json_encode($request->all()).'|'.json_encode($errors));
|
|
|
return response()->json(['result'=>'failure','fail_info'=>'error','errors'=>$errors])->setEncodingOptions(JSON_UNESCAPED_UNICODE);
|
|
|
}
|
|
|
-// if(!UserToken::getUser($token)){
|
|
|
-// return ['result'=>'unauthority','fail_info'=>'无效令牌或令牌过期'];
|
|
|
-// }
|
|
|
|
|
|
// 同步orderCommodity
|
|
|
$this->syncOrder($batch_id);
|