xiaogang 4 anni fa
parent
commit
89d7e5b9e8
1 ha cambiato i file con 4 aggiunte e 4 eliminazioni
  1. 4 4
      app/Http/Controllers/Api/HomeController.php

+ 4 - 4
app/Http/Controllers/Api/HomeController.php

xqd
@@ -184,12 +184,12 @@ class HomeController extends Controller
             $cache_eq_id = $request->header('uniqueID','');//获取设备码
             $lock = Cache::lock(ApiEnum::PHOTO_DESTROY_LOCK.$cache_eq_id, 1);
 
-            dd(Cache::get(ApiEnum::PHOTO_DESTROY_URL.$cache_eq_id.md5($request->url)));
+            //dd(Redis::get(ApiEnum::PHOTO_DESTROY_URL.$cache_eq_id.md5($request->url)));
             if ($lock->get()) {
                 if(!$user){
-                    if(!Cache::has(ApiEnum::PHOTO_DESTROY_URL.$cache_eq_id.md5($request->url))){
-                        Cache::put(ApiEnum::PHOTO_DESTROY_URL.$cache_eq_id.md5($request->url),$request->url,'86400');
-                        dd(Cache::get(ApiEnum::PHOTO_DESTROY_URL.$cache_eq_id.md5($request->url)));
+                    if(!Redis::get(ApiEnum::PHOTO_DESTROY_URL.$cache_eq_id.md5($request->url))){
+                        Redis::set(ApiEnum::PHOTO_DESTROY_URL.$cache_eq_id.md5($request->url),$request->url);
+                        dd(Redis::get(ApiEnum::PHOTO_DESTROY_URL.$cache_eq_id.md5($request->url)));
                     }
                 }else{
                     if(!UserPhotoDestroy::query()->where(['user_id'=>$user->id,'url'=>$request->url])->first()){