Skip to content

Commit

Permalink
Merge pull request #131 from wonder-game/develop
Browse files Browse the repository at this point in the history
 增加_after_requestParams
  • Loading branch information
linkunyuan authored Nov 22, 2024
2 parents 7196b5d + 7721e14 commit e119cb3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Common/Classes/XlsWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ public function ouputFileByCursor(string $file, array $header, $data, $rowCall =
$row = [];
// 因为data只能是索引数组,所以这里按顺序十分重要
foreach ($thKeys as $col) {
$row[] = $value[$col] ?? '';
$row[] = isset($value[$col]) ? (is_numeric($value[$col]) ? floatval($value[$col]) : $value[$col]) : '';
}

$row && $newarr[] = $row;
Expand Down
15 changes: 13 additions & 2 deletions src/HttpController/BaseControllerTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,17 @@ protected function requestParams()

// $this->request()->getSwooleRequest()->rawContent()也可以
$this->raw = $this->request()->getBody()->__toString();
// 可以在这个方法里进行项目级别的个性处理
$this->_after_requestParams();
}

/**
* 可以在这个方法里进行项目级别的个性处理
* 例如对请求数据的解混淆、……
*/
protected function _after_requestParams()
{

}

protected function setLanguageConstants()
Expand Down Expand Up @@ -271,8 +282,8 @@ protected function actionNotFound(?string $action)
* 接口限流,redis计数
* @param Redis $redis
* @param string $cfgKey
* @param $input
* @param $isWhite 是否白名单,白名单不受限制
* @param array $input
* @param bool $isWhite 是否白名单,白名单不受限制
* @return \Closure
* @throws HttpParamException
*/
Expand Down

0 comments on commit e119cb3

Please sign in to comment.