xiaogang 4 rokov pred
rodič
commit
55e3e1c8c8

+ 8 - 8
app/Http/Controllers/Api/UserController.php

@@ -416,20 +416,20 @@ class UserController extends Controller
         try {
         try {
             $user = auth('api')->user();
             $user = auth('api')->user();
             $userinfo = UserInfoModel::query()->where('user_id',$user->id)->first();
             $userinfo = UserInfoModel::query()->where('user_id',$user->id)->first();
-//            if(empty($request->auth_pic)){
-//                throw new Exception("参数错误");
-//            }
+            if(empty($request->auth_pic)){
+                throw new Exception("参数错误");
+            }
 
 
             $images = array(
             $images = array(
                 array(
                 array(
-//                    'image' => base64_encode(file_get_contents($userinfo->avatar)),
-                    'image' => base64_encode(file_get_contents("https://zhengda.oss-accelerate.aliyuncs.com/tinymce/images/dcdc14c5987ebbb233a6232264bb80e260f4f496e12ba.jpg")),
+                    'image' => base64_encode(file_get_contents($userinfo->avatar)),
+//                    'image' => base64_encode(file_get_contents("https://zhengda.oss-accelerate.aliyuncs.com/tinymce/images/dcdc14c5987ebbb233a6232264bb80e260f4f496e12ba.jpg")),
                     'image_type' => 'BASE64',
                     'image_type' => 'BASE64',
                     'liveness_control'=>'NORMAL',
                     'liveness_control'=>'NORMAL',
                 ),
                 ),
                 array(
                 array(
-//                    'image' => base64_encode(file_get_contents($request->auth_pic)),
-                    'image' => base64_encode(file_get_contents("https://zhengda.oss-accelerate.aliyuncs.com/tinymce/images/cea206a2046b895f253445f35794226860f4f4df1d786.jpg")),
+                    'image' => base64_encode(file_get_contents($request->auth_pic)),
+//                    'image' => base64_encode(file_get_contents("https://zhengda.oss-accelerate.aliyuncs.com/tinymce/images/cea206a2046b895f253445f35794226860f4f4df1d786.jpg")),
                     'image_type' => 'BASE64',
                     'image_type' => 'BASE64',
                     //'liveness_control'=>'NORMAL',
                     //'liveness_control'=>'NORMAL',
                 ),
                 ),
@@ -437,7 +437,7 @@ class UserController extends Controller
             $result = $apiFace->match($images);
             $result = $apiFace->match($images);
 //            $result = json_decode($result,true);
 //            $result = json_decode($result,true);
             if($result['error_code']==0){
             if($result['error_code']==0){
-                if($result['result']['score']<80){
+                if($result['result']['score']>80){
                     $user->is_auth = 1;
                     $user->is_auth = 1;
                     $user->save();
                     $user->save();
                 }else{
                 }else{