Commit 651eb6b8 authored by Liu lu's avatar Liu lu

Vtiful\Kernel\Excel 优化

parent 1e260b27
...@@ -49,19 +49,14 @@ class LogTraceHandler ...@@ -49,19 +49,14 @@ class LogTraceHandler
public static function createLogTrace($source, $params) public static function createLogTrace($source, $params)
{ {
if(!Coroutine::inCoroutine()) return; if(!Coroutine::inCoroutine()) return;
$userName = '';
try {
$userName = \Meibuyu\Micro\Model\Auth::user()['name'];
}catch (\Throwable $exception){
}
LogTrace::insertOrIgnore([ LogTrace::insertOrIgnore([
'request_id' => self::getRequestId(), 'request_id' => self::getRequestId(),
'origin_params' => json_encode($params), 'origin_params' => json_encode($params),
'source' => $source, 'source' => $source,
'created_at' => now(), 'created_at' => now(),
'process_info' => '', 'process_info' => '',
'user_name' => $userName 'user_name' => Context::get('auth')['name']??''
]); ]);
} }
......
...@@ -60,6 +60,15 @@ class KernelExcelExportService ...@@ -60,6 +60,15 @@ class KernelExcelExportService
$this->fileObject = (new \Vtiful\Kernel\Excel(['path' => $dir]))->constMemory($fileName); $this->fileObject = (new \Vtiful\Kernel\Excel(['path' => $dir]))->constMemory($fileName);
} }
/**
* @return mixed
*/
public function getFileObject()
{
return $this->fileObject;
}
/** /**
* 设置居中样式 * 设置居中样式
* @param $width 列宽 * @param $width 列宽
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment