浏览代码

用户资料

lizhen_gitee 1 年之前
父节点
当前提交
6e661136ce
共有 2 个文件被更改,包括 4 次插入3 次删除
  1. 3 3
      application/common/library/Auth.php
  2. 1 0
      application/extra/site.php

+ 3 - 3
application/common/library/Auth.php

@@ -26,7 +26,7 @@ class Auth
     //默认配置
     protected $config = [];
     protected $options = [];
-    protected $allowFields = ['id', 'username', 'mobile', 'avatar'];
+    protected $allowFields = ['id', 'username', 'mobile', 'avatar', 'email', 'firstname', 'lastname'];
 
     public function __construct($options = [])
     {
@@ -174,7 +174,7 @@ class Auth
             'email'    => $email,
             'mobile'   => $mobile,
             'nickname'  => $this->get_rand_nick_name(),
-            'avatar'   => '/assets/img/avatar.png',
+            'avatar'   => config('site.default_avatar'),
         ];
         $params = array_merge($data, [
             'salt'      => Random::alnum(),
@@ -406,7 +406,7 @@ class Auth
         $userinfo = array_merge($userinfo, Token::get($this->_token));
 
         //追加
-        $userinfo['avatar'] = one_domain_image($userinfo['avatar']);
+        $userinfo['avatar'] = localpath_to_netpath($userinfo['avatar']);
         $userinfo['role_type'] = 'user';//角色:用户
 
         return $userinfo;

+ 1 - 0
application/extra/site.php

@@ -62,4 +62,5 @@ return array (
   'trylesson_cancel_text' => 'For any cancellations less than 24hours before the session,your membership packgae will automatically be deducted in the syetem and for those who pay Per Session,your payment will not be refunded.',
   'map_longitude' => '103.8014002',
   'map_latitude' => '1.2763445',
+  'default_avatar' => '/uploads/20231228/e0658ff50cff476b2b9eb021966de43c.png',
 );