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',
 );