Explorar el Código

Wesmiler 三勾多商户商城提交

wesmiler hace 3 años
padre
commit
b6e987a90b
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  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){
         $fileName = '/uploads/qrcode/'.$sid.'_'.md5($sid).'.jpg';
         $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)){
             return getPreview($fileName);
         }