主题管理

feat/task1-c-wallet
gongfuxiang 2018-12-19 01:22:03 +08:00
parent 4bb318149a
commit e7beb27d38
1 changed files with 12 additions and 2 deletions

View File

@ -90,6 +90,16 @@ class ThemeService
return DataReturn('文件格式有误请上传zip压缩包', -2);
}
// 目录是否有权限
if(!is_writable(ROOT.self::$html_path))
{
return DataReturn('视图目录没权限', -10);
}
if(!is_writable(ROOT.self::$static_path))
{
return DataReturn('资源目录没权限', -10);
}
// 开始解压文件
$resource = zip_open($_FILES['theme']['tmp_name']);
while(($temp_resource = zip_read($resource)) !== false)
@ -105,10 +115,10 @@ class ThemeService
// 拼接路径
if(strpos($file, '_html') !== false)
{
$file = self::$html_path.$file;
$file = ROOT.self::$html_path.$file;
} else if(strpos($file, '_static') !== false)
{
$file = self::$static_path.$file;
$file = ROOT.self::$static_path.$file;
} else {
continue;
}