增加上传文件验证、班级删除权限
This commit is contained in:
1 parent
efb20233c5
commit
3b8e2efed5
2 files changed
+14
-2
No files matched your search
+12
-1
@@ -235,6 +235,17 @@ function teacherNames($list = array())
|
||||
*/
|
||||
function saveFileInfo($file,$list,$isSave=false)
|
||||
{
|
||||
$hash = $file->hash('sha1');
|
||||
$f = new \app\system\model\Fields;
|
||||
$serFile = $f::where('hash',$hash)->find();
|
||||
if($serFile)
|
||||
{
|
||||
$data['msg'] = '文件已经存在';
|
||||
$data['val'] = true;
|
||||
$data['url'] = $serFile->url;
|
||||
return $data;
|
||||
}
|
||||
|
||||
// 上传文件到本地服务器
|
||||
$savename = \think\facade\Filesystem::disk('public')->putFile($list['serurl'], $file);
|
||||
// 重新组合文件路径
|
||||
@@ -250,7 +261,7 @@ function teacherNames($list = array())
|
||||
$list['category'] = $list['category'];
|
||||
$list['bianjitime'] = $file->getMTime();
|
||||
$list['extension'] = $file->getOriginalExtension();
|
||||
$f = new \app\system\model\Fields;
|
||||
|
||||
$saveinfo = $f::create($list);
|
||||
}
|
||||
|
||||
|
||||
@@ -159,7 +159,8 @@ class Rule extends Seeder
|
||||
['title'=>'添加','name'=>'teach/Banji/create','paixu' =>1,'pid'=>502],
|
||||
['title'=>'保存','name'=>'teach/Banji/save','paixu' =>2,'pid'=>502],
|
||||
['title'=>'移动','name'=>'teach/Banji/yidong','paixu'=>3,'pid'=>502],
|
||||
['title'=>'状态','name'=>'teach/Banji/setStatus','paixu'=>4,'pid'=>502],
|
||||
['title'=>'删除','name'=>'teach/Banji/delete','paixu'=>4,'pid'=>502],
|
||||
['title'=>'状态','name'=>'teach/Banji/setStatus','paixu'=>5,'pid'=>502],
|
||||
// 学科列表权限
|
||||
['title'=>'添加','name'=>'teach/Subject/create','paixu' =>1,'pid'=>503],
|
||||
['title'=>'保存','name'=>'teach/Subject/save','paixu' =>2,'pid'=>503],
|
||||
|
||||
Reference in new issue
Block a user