Browse Source

用户接口

lizhen_gitee 7 months ago
parent
commit
ed2d5f8ff3

+ 1 - 3
addons/alioss/controller/Index.php

@@ -80,9 +80,7 @@ class Index extends Controller
     public function upload($isApi = false)
     {
         if ($isApi === true) {
-            if (!$this->auth->isLogin()) {
-                $this->error("请登录后再进行操作");
-            }
+
         } else {
             $this->check();
         }

+ 1 - 1
application/api/controller/User.php

@@ -16,7 +16,7 @@ use think\Db;
  */
 class User extends Api
 {
-    protected $noNeedLogin = [''];
+    protected $noNeedLogin = ['wxmini_regmobile_login'];
     protected $noNeedRight = '*';
 
     public function _initialize()

+ 5 - 1
application/common/library/Auth.php

@@ -26,7 +26,7 @@ class Auth
     //默认配置
     protected $config = [];
     protected $options = [];
-    protected $allowFields = ['id', 'username', 'nickname', 'mobile', 'avatar', 'score'];
+    protected $allowFields = ['id', 'nickname', 'mobile', 'avatar', 'group_id'];
 
     public function __construct($options = [])
     {
@@ -373,6 +373,10 @@ class Auth
         $allowFields = $this->getAllowFields();
         $userinfo = array_intersect_key($data, array_flip($allowFields));
         $userinfo = array_merge($userinfo, Token::get($this->_token));
+
+
+        $userinfo['avatar'] = localpath_to_netpath($userinfo['avatar']);
+
         return $userinfo;
     }