作者 潘浩文
1 个管道 的构建 通过 耗费 5 秒

接口对接测试

... ... @@ -258,23 +258,23 @@ class BusinessController extends Controller
if ($info) {
$saveName = $info->getSaveName();
$originalName = $info->getInfo('name');//name,type,size
// $fileSize = $info->getInfo('size');
// $suffix = $info->getExtension();
//
// $fileKey = $fileMd5 . md5($fileSha1);
//
// $userId = $this->getUser()['user_id'];
// Db::name('asset')->insert([
// 'user_id' => $userId,
// 'file_key' => $fileKey,
// 'filename' => $originalName,
// 'file_size' => $fileSize,
// 'file_path' => cmf_get_asset_url($saveName),
// 'file_md5' => $fileMd5,
// 'file_sha1' => $fileSha1,
// 'create_time' => time(),
// 'suffix' => $suffix
// ]);
$fileSize = $info->getInfo('size');
$suffix = $info->getExtension();
$fileKey = $fileMd5 . md5($fileSha1);
$userId = $this->getUser()['user_id'];
Db::name('asset')->insert([
'user_id' => $userId,
'file_key' => $fileKey,
'filename' => $originalName,
'file_size' => $fileSize,
'file_path' => cmf_get_asset_url($saveName),
'file_md5' => $fileMd5,
'file_sha1' => $fileSha1,
'create_time' => time(),
'suffix' => $suffix
]);
// $storage = cmf_get_option('storage');
... ...
... ... @@ -320,6 +320,6 @@ class Controller
$this->error(['code' => 10001, 'msg' => '用户未登录']);
}
return $this->user;
//return 2;
//return 2;
}
}
... ...