Skip to content

Commit

Permalink
优化更新
Browse files Browse the repository at this point in the history
  • Loading branch information
deatil committed Dec 8, 2021
1 parent 6224707 commit 48fdef2
Show file tree
Hide file tree
Showing 25 changed files with 60 additions and 49 deletions.
5 changes: 5 additions & 0 deletions src/Auth/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class Admin

/**
* 用户登录
*
* @param string $name 账户名
* @param string $password (md5值) 密码
* @return bool|mixed
Expand Down Expand Up @@ -90,6 +91,7 @@ public function getInfo($id)

/**
* 检测密码
*
* @param type $identifier 用户名或者用户ID
* @param type $password 密码
* @return boolean
Expand All @@ -116,6 +118,7 @@ public function checkPassword($identifier, $password)

/**
* 检验用户是否已经登陆
*
* @return boolean
*/
public function check()
Expand Down Expand Up @@ -182,6 +185,7 @@ public function isSuperAdmin($id = null)

/**
* 注销登录状态
*
* @return boolean
*/
public function logout()
Expand All @@ -195,6 +199,7 @@ public function logout()

/**
* 管理员密码加密
*
* @param $password
* @param $encrypt //传入加密串,在修改密码时做认证
* @return array/password
Expand Down
2 changes: 1 addition & 1 deletion src/Auth/Check.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ protected function checkMatchUrl($name, $auth)
}

/**
* 格式化name
* 格式化 name
*
* @param string $name 要检测的名称
* @return string
Expand Down
6 changes: 6 additions & 0 deletions src/Auth/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class Parser

/**
* 设置
*
* @param string $url 链接地址
* @return object
*/
Expand All @@ -40,6 +41,7 @@ public function withUrl($url)

/**
* 获取链接
*
* @return string
*/
public function getUrl()
Expand All @@ -49,6 +51,7 @@ public function getUrl()

/**
* 获取地址
*
* @return string
*/
public function getPath()
Expand All @@ -58,6 +61,7 @@ public function getPath()

/**
* 获取参数
*
* @return array
*/
public function getParam()
Expand All @@ -67,6 +71,7 @@ public function getParam()

/**
* 解析
*
* @return Parser
*/
public function parse()
Expand All @@ -87,6 +92,7 @@ public function parse()

/**
* 解析
*
* @return Parser
*/
public function parseUrl()
Expand Down
2 changes: 2 additions & 0 deletions src/Auth/Permission.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class Permission
{
/**
* 检查权限
*
* @param string|array name 需要验证的规则列表,支持逗号分隔的权限规则或索引数组
* @param integer uid 认证用户的id
* @param string relation 如果为 'or' 表示满足任一条规则即通过验证;如果为 'and'则表示需满足所有规则才能通过验证
Expand All @@ -40,6 +41,7 @@ public function check(

/**
* 获得权限列表
*
* @param integer $uid 用户id
*/
public function getAuthList($uid, $type)
Expand Down
3 changes: 3 additions & 0 deletions src/Auth/Rule.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public function __construct($type = 1)

/**
* 获得权限列表
*
* @param integer $uid 用户id
* @param integer $type 选择类型
*/
Expand Down Expand Up @@ -92,6 +93,7 @@ public function getAuthList($uid)

/**
* 获得权限ID列表
*
* @param array $gids 分组id列表
* @return array
*/
Expand All @@ -107,6 +109,7 @@ public function getGroupRuleidList($gids = [])

/**
* 根据用户id获取用户组,返回值为数组
*
* @param integer uid 用户id
* @return array 用户所属的用户组
* array(
Expand Down
2 changes: 1 addition & 1 deletion src/Command/Flash.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
/**
* 闪存
*
* php think laket-admin:flash [--package=package_name] [--action=install]
* > php think laket-admin:flash [--package=package_name] [--action=install]
*
* @create 2021-4-7
* @author deatil
Expand Down
2 changes: 1 addition & 1 deletion src/Command/Install.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/**
* 系统安装
*
* php think laket-admin:install
* > php think laket-admin:install
*
* @create 2020-3-20
* @author deatil
Expand Down
2 changes: 1 addition & 1 deletion src/Command/Publish.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/**
* 推送
*
* php think laket-admin:publish --tag=tag-name
* > php think laket-admin:publish --tag=tag-name
*
* @create 2021-3-26
* @author deatil
Expand Down
2 changes: 1 addition & 1 deletion src/Command/ResetPassword.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/**
* 重设密码
*
* php think laket-admin:reset-password
* > php think laket-admin:reset-password
*
* @create 2021-3-20
* @author deatil
Expand Down
1 change: 1 addition & 0 deletions src/Controller/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ abstract class Base extends BaseController

/**
* 控制器中间件
*
* @var array
*/
protected $middleware = [];
Expand Down
1 change: 1 addition & 0 deletions src/Exception/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class Handler extends Handle
{
/**
* 不需要记录信息(日志)的异常类列表
*
* @var array
*/
protected $ignoreReport = [
Expand Down
29 changes: 4 additions & 25 deletions src/Flash/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ class Manager
public $flashs = [];

/**
* @var string 本地闪存缓存id
* 本地闪存缓存id
*
* @var string
*/
public $flashsCacheId = 'laket-admin-local-flashs';

Expand All @@ -41,7 +43,6 @@ class Manager
*
* @param string $name 包名
* @param string $class 绑定服务类
*
* @return self
*/
public function extend($name, $class = null)
Expand All @@ -59,7 +60,6 @@ public function extend($name, $class = null)
* 获取添加的闪存
*
* @param string $name
*
* @return string
*/
public function getExtend($name = null)
Expand All @@ -75,7 +75,6 @@ public function getExtend($name = null)
* 移除添加的闪存
*
* @param string $name
*
* @return string|null
*/
public function forget($name)
Expand All @@ -93,7 +92,6 @@ public function forget($name)
* 检测非compoer闪存是否存在
*
* @param string $name 闪存包名
*
* @return bool
*/
public function checkLocal($name)
Expand All @@ -111,7 +109,6 @@ public function checkLocal($name)
* 设置闪存路由
*
* @param $callback
*
* @return self
*/
public function routes($callback)
Expand All @@ -127,7 +124,6 @@ public function routes($callback)
*
* @param $prefix
* @param $paths
*
* @return self
*/
public function namespaces($prefix, $paths = [])
Expand All @@ -143,7 +139,6 @@ public function namespaces($prefix, $paths = [])
* 登陆过滤
*
* @param array $excepts
*
* @return void
*/
public function authenticateExcepts(array $excepts = [])
Expand All @@ -166,7 +161,6 @@ public function authenticateExcepts(array $excepts = [])
* 权限过滤
*
* @param array $excepts
*
* @return void
*/
public function permissionExcepts(array $excepts = [])
Expand All @@ -189,7 +183,6 @@ public function permissionExcepts(array $excepts = [])
* 锁屏过滤
*
* @param array $excepts
*
* @return void
*/
public function screenlockExcepts(array $excepts = [])
Expand All @@ -212,7 +205,6 @@ public function screenlockExcepts(array $excepts = [])
* 执行sql
*
* @param string $sql sql字符或者文件
*
* @return boolen
*/
public function executeSql(string $sql)
Expand Down Expand Up @@ -444,7 +436,6 @@ public function refresh()
* 移除闪存信息缓存
*
* @param string $name
*
* @return self
*/
public function forgetFlashCache(string $name)
Expand All @@ -463,7 +454,6 @@ public function forgetFlashCache(string $name)
* 闪存存放文件夹
*
* @param string $path
*
* @return string
*/
public function getFlashDirectory()
Expand All @@ -475,7 +465,6 @@ public function getFlashDirectory()
* 闪存存放目录
*
* @param string $path
*
* @return string
*/
public function getFlashPath(string $path = '')
Expand All @@ -488,7 +477,6 @@ public function getFlashPath(string $path = '')
* 闪存绑定类
*
* @param string|null $name
*
* @return string
*/
public function getFlashClass(?string $name = null)
Expand All @@ -506,7 +494,6 @@ public function getFlashClass(?string $name = null)
* 实例化类
*
* @param string|null $className
*
* @return object
*/
public function getNewClass(?string $className = null)
Expand All @@ -531,7 +518,6 @@ public function getNewClass(?string $className = null)
* @param string|null $className
* @param string|null $method
* @param array $param
*
* @return mixed
*/
public function getNewClassMethod(?string $className = null, ?string $method = null, array $param = [])
Expand All @@ -557,7 +543,6 @@ public function getNewClassMethod(?string $className = null, ?string $method = n
* 闪存的实例化类
*
* @param string|null $name
*
* @return mixed|object
*/
public function getFlashNewClass(?string $name = null)
Expand All @@ -571,7 +556,6 @@ public function getFlashNewClass(?string $name = null)
* 闪存标识
*
* @param object|null $newClass
*
* @return string
*/
public function getFlashIcon(?object $newClass = null)
Expand Down Expand Up @@ -599,7 +583,6 @@ public function getFlashIcon(?object $newClass = null)
* 闪存信息
*
* @param string|null $name
*
* @return array
*/
public function getFlash(?string $name = null)
Expand Down Expand Up @@ -693,9 +676,8 @@ public function getFlashs()
* 闪存标识图片
*
* @param string|null $icon
*
* @return string
*/
*/
public function getIcon($icon = '')
{
if (! file_exists($icon) || ! is_file($icon)) {
Expand All @@ -714,7 +696,6 @@ public function getIcon($icon = '')
* 验证闪存信息
*
* @param array $info
*
* @return boolen
*/
public function validateInfo(array $info)
Expand Down Expand Up @@ -744,7 +725,6 @@ public function validateInfo(array $info)
* 获取满足条件的闪存文件夹
*
* @param string|null $dirPath
*
* @return array
*/
public function getDirectories(?string $dirPath = null)
Expand Down Expand Up @@ -779,7 +759,6 @@ public function getDirectories(?string $dirPath = null)
* 根据类名获取类所在文件夹
*
* @param string|object|null $class
*
* @return string|bool
*/
public function getPathFromClass($class = null)
Expand Down
Loading

0 comments on commit 48fdef2

Please sign in to comment.