Browse Source

PC端权限

lizhen_gitee 8 months ago
parent
commit
efd4e750fc

+ 1 - 1
application/common/library/Authcompany.php

@@ -24,7 +24,7 @@ class Authcompany extends \fast\Authpc
     protected $requestUri = '';
     protected $rules = [];
     //默认配置
-    protected $config = [];
+//    protected $config = [];
     protected $options = [];
     protected $allowFields = ['id','username','nickname','avatar','company_id' ];
 

+ 4 - 0
application/company/controller/Index.php

@@ -55,6 +55,8 @@ class Index extends Apic
      */
     public function logout()
     {
+        PcAdminLog::setTitle('退出登录');
+
         if (!$this->request->isPost()) {
             $this->error(__('Invalid parameters'));
         }
@@ -65,6 +67,8 @@ class Index extends Apic
 
     //用户详细资料
     public function getUserinfo(){
+        PcAdminLog::setTitle('获取信息');
+
         $info = $this->auth->getUserInfo();
 
         $this->success(__('success'),$info);

+ 2 - 2
extend/fast/Authpc.php

@@ -204,7 +204,7 @@ class Authpc
             //超级管理员无需验证condition
             if (!empty($rule['condition']) && !in_array('*', $ids)) {
                 //根据condition进行验证
-                $user = $this->getUserInfo($uid); //获取用户信息,一维数组
+                $user = $this->getUserInfo_self($uid); //获取用户信息,一维数组
                 $nums = 0;
                 $condition = str_replace(['&&', '||'], "\r\n", $rule['condition']);
                 $condition = preg_replace('/\{(\w*?)\}/', '\\1', $condition);
@@ -249,7 +249,7 @@ class Authpc
      * @param int $uid 用户id
      * @return mixed
      */
-    protected function getUserInfo($uid)
+    protected function getUserInfo_self($uid)
     {
         static $user_info = [];