xiaogang 4 سال پیش
والد
کامیت
1b001b0c45
1فایلهای تغییر یافته به همراه3 افزوده شده و 3 حذف شده
  1. 3 3
      app/Http/Controllers/Api/HomeController.php

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

xqd
@@ -183,11 +183,11 @@ class HomeController extends Controller
             $user = auth('api')->user();
             $cache_eq_id = $request->header('uniqueID','');//获取设备码
             $lock = Cache::lock(ApiEnum::PHOTO_DESTROY_LOCK.$cache_eq_id, 1);
-dd(Redis::get(ApiEnum::PHOTO_DESTROY_URL.$cache_eq_id.md5($request->url)));
             if ($lock->get()) {
                 if(!$user){
-                    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);
+                    if(!Cache::get(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)));
                     }
                 }else{
                     if(!UserPhotoDestroy::query()->where(['user_id'=>$user->id,'url'=>$request->url])->first()){