|
@@ -307,7 +307,7 @@ class UserController extends Controller
|
|
|
|
|
|
if($user->is_vip>0){
|
|
if($user->is_vip>0){
|
|
$info = UserVipLogModel::query()->where(['user_id'=>$user->id])->first();
|
|
$info = UserVipLogModel::query()->where(['user_id'=>$user->id])->first();
|
|
- $res['end_day'] = date("Y-m-d",strtotime($info['end_day']));
|
|
|
|
|
|
+ $res['end_day'] = date("Y/m/d",strtotime($info['end_day']));
|
|
}else{
|
|
}else{
|
|
$res['end_day'] = "";
|
|
$res['end_day'] = "";
|
|
}
|
|
}
|
|
@@ -382,24 +382,30 @@ class UserController extends Controller
|
|
public function check_auth(Request $request){
|
|
public function check_auth(Request $request){
|
|
$apiFace = new \AipFace(env('BAI_DU_YUN_APP_ID'),env('BAI_DU_YUN_API_KEY'),env('BAI_DU_YUN_SECRET_KEY'));
|
|
$apiFace = new \AipFace(env('BAI_DU_YUN_APP_ID'),env('BAI_DU_YUN_API_KEY'),env('BAI_DU_YUN_SECRET_KEY'));
|
|
try {
|
|
try {
|
|
- $images = array(
|
|
|
|
-// array(
|
|
|
|
-// 'image' => base64_encode(file_get_contents('https://zhengda.oss-accelerate.aliyuncs.com/tinymce/images/dcdc14c5987ebbb233a6232264bb80e260e7ef418313d.jpg')),
|
|
|
|
-// 'image_type' => 'BASE64',
|
|
|
|
-//// 'liveness_control'=>'HIGH',
|
|
|
|
-// ),
|
|
|
|
|
|
+ if(empty($request->avatar)){
|
|
|
|
+ throw new Exception("请上传头像");
|
|
|
|
+ }
|
|
|
|
+ if(empty($request->photo)){
|
|
|
|
+ throw new Exception("请上传生活照");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $images = array(
|
|
array(
|
|
array(
|
|
- 'image' => base64_encode(file_get_contents('https://zhengda.oss-accelerate.aliyuncs.com/tinymce/images/cea206a2046b895f253445f35794226860e7ef561e3ac.jpg')),
|
|
|
|
|
|
+ 'image' => base64_encode(file_get_contents($request->avatar)),
|
|
'image_type' => 'BASE64',
|
|
'image_type' => 'BASE64',
|
|
'liveness_control'=>'NORMAL',
|
|
'liveness_control'=>'NORMAL',
|
|
),
|
|
),
|
|
- array(
|
|
|
|
- 'image' => base64_encode(file_get_contents('https://zhengda.oss-accelerate.aliyuncs.com/tinymce/images/cbc1fe6ae109bd0d11b32d066dcd4d7f60e7f1ee5d624.jpg')),
|
|
|
|
|
|
+ array(
|
|
|
|
+ 'image' => base64_encode(file_get_contents($request->photo)),
|
|
'image_type' => 'BASE64',
|
|
'image_type' => 'BASE64',
|
|
-// 'liveness_control'=>'NORMAL',
|
|
|
|
|
|
+ //'liveness_control'=>'NORMAL',
|
|
),
|
|
),
|
|
);
|
|
);
|
|
$res = $apiFace->match($images);
|
|
$res = $apiFace->match($images);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
}catch (\Exception $exception){
|
|
}catch (\Exception $exception){
|
|
return $this->response->errorForbidden($exception->getMessage());
|
|
return $this->response->errorForbidden($exception->getMessage());
|
|
}
|
|
}
|