瀏覽代碼

Update User model

Visman 3 年之前
父節點
當前提交
d2e0f4e31d
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      app/Models/User/User.php

+ 3 - 2
app/Models/User/User.php

@@ -184,10 +184,11 @@ class User extends DataModel
         $file = $this->getAttr('avatar');
         $file = $this->getAttr('avatar');
 
 
         if (! empty($file)) {
         if (! empty($file)) {
-            $path = $this->c->DIR_PUBLIC . "{$this->c->config->o_avatars_dir}/{$file}";
+            $file = $this->c->config->o_avatars_dir . '/' . $file;
+            $path = $this->c->DIR_PUBLIC . $file;
 
 
             if (\is_file($path)) {
             if (\is_file($path)) {
-                return $this->c->PUBLIC_URL . "{$this->c->config->o_avatars_dir}/{$file}";
+                return $this->c->PUBLIC_URL . $file;
             }
             }
         }
         }