Procházet zdrojové kódy

Wesmiler 三勾多商户商城提交

wesmiler před 3 roky
rodič
revize
b6e987a90b
1 změnil soubory, kde provedl 4 přidání a 0 odebrání
  1. 4 0
      app/api/model/user/User.php

+ 4 - 0
app/api/model/user/User.php

@@ -253,6 +253,10 @@ class User extends UserModel
     public static function getQrcode($sid){
     public static function getQrcode($sid){
         $fileName = '/uploads/qrcode/'.$sid.'_'.md5($sid).'.jpg';
         $fileName = '/uploads/qrcode/'.$sid.'_'.md5($sid).'.jpg';
         $cache = Cache::get('caches:qrcode:'.$sid);
         $cache = Cache::get('caches:qrcode:'.$sid);
+        if(!is_dir(app()->getRootPath().'public')){
+            mkdir(app()->getRootPath().'public',0755, true);
+        }
+        
         if($cache && file_exists(app()->getRootPath().'public'.$fileName)){
         if($cache && file_exists(app()->getRootPath().'public'.$fileName)){
             return getPreview($fileName);
             return getPreview($fileName);
         }
         }