Просмотр исходного кода

Wesmiler 三勾多商户商城提交

wesmiler 3 лет назад
Родитель
Сommit
b6e987a90b
1 измененных файлов с 4 добавлено и 0 удалено
  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);
         }