Skip to content

Commit

Permalink
导出功能一处修复
Browse files Browse the repository at this point in the history
  • Loading branch information
gongwen committed Aug 18, 2015
1 parent 0689bf2 commit ead4586
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 29 deletions.
2 changes: 1 addition & 1 deletion MinPHP/core/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
//版本信息
'version'=>array(
'no' => 'v1.1', //版本号
'time' => '2015-07-31 14:00', //版本时间
'time' => '2015-08-19 00:17', //版本时间
)

);
44 changes: 22 additions & 22 deletions MinPHP/core/function.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,25 +150,25 @@ function downfile($fileName){
exit();
}

/**
* @dec 下载文件 指定了content参数,下载该参数的内容
* @access public
* @param string $showname 下载显示的文件名
* @param string $content 下载的内容
* @param integer $expire 下载内容浏览器缓存时间
* @return void
*/
function download($showname='',$content='',$expire=180) {
$type = "application/octet-stream";
//发送Http Header信息 开始下载
header("Pragma: public");
header("Cache-control: max-age=".$expire);
//header('Cache-Control: no-store, no-cache, must-revalidate');
header("Expires: " . gmdate("D, d M Y H:i:s",time()+$expire) . "GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s",time()) . "GMT");
header("Content-Disposition: attachment; filename=".$showname);
header("Content-type: ".$type);
header('Content-Encoding: none');
header("Content-Transfer-Encoding: binary" );
die($content);
}
/**
* @dec 下载文件 指定了content参数,下载该参数的内容
* @access public
* @param string $showname 下载显示的文件名
* @param string $content 下载的内容
* @param integer $expire 下载内容浏览器缓存时间
* @return void
*/
function download($showname='',$content='',$expire=180) {
$type = "application/octet-stream";
//发送Http Header信息 开始下载
header("Pragma: public");
header("Cache-control: max-age=".$expire);
//header('Cache-Control: no-store, no-cache, must-revalidate');
header("Expires: " . gmdate("D, d M Y H:i:s",time()+$expire) . "GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s",time()) . "GMT");
header("Content-Disposition: attachment; filename=".$showname);
header("Content-type: ".$type);
header('Content-Encoding: none');
header("Content-Transfer-Encoding: binary" );
die($content);
}
8 changes: 4 additions & 4 deletions MinPHP/run/export.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ function getJSFileContent($matches){
//js文件替换--end
//========js与css静态文件替换end=======================================

//=======页面锚点连接替换start=======================================
$pattern = '/(href=[\"\']).*tag=\d#(\w+)/is';
//=======页面锚点连接替换start=========================================
$pattern = '/href=".+?tag=\d#(\w+)"/i';
function changeLink($matches){
return "{$matches[1]}#{$matches[2]}";
return "href=#{$matches[1]}";
}
$content = preg_replace_callback($pattern,'changeLink',$content);
$tag = C('version->no');
//=======页面锚点连接替换end=========================================
$tag = C('version->no');
$headhtml=<<<START
<!--
=======================================================================
Expand Down
6 changes: 5 additions & 1 deletion MinPHP/run/sort.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<?php defined('API') or exit();?>
<?php
defined('API') or exit();
if(!is_supper()){die('只有超级管理员才可进行排序操作');}
?>

<!--接口排序管理start-->
<?php
//操作类型{type}
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
第三步: 愉快的使用ing

[注]
1)此版本为v1.0版本,权限控制。仅有超级管理员权限
1)此版本为v1.1版本,权限控制。仅有超级管理员权限
2)”游客”,只能查看接口分类,与接口信息(无增删改查权限)
3)此版本默认的管理员有两个分别为admin(密码:654321)与root(密码:123456)。帐号可以手动修改user数据表

Expand Down

0 comments on commit ead4586

Please sign in to comment.