作者 郭文星

111

... ... @@ -321,6 +321,7 @@ class Login extends Base
}
public function uploadBase64($base64Str)
{
// 将Base64字符串转换为文件并保存
if ($base64Str) {
// 获取Base64字符串的类型
... ... @@ -331,10 +332,12 @@ class Login extends Base
// 获取项目根目录
//$rootPath = root_path();
// 保存文件路径
$filePath = ROOT_PATH . 'public/uploads/' . $fileName;
$filePath = ROOT_PATH . 'public/uploads/store_qrcode/' . $fileName;
// 保存文件
file_put_contents($filePath, base64_decode(str_replace($match[0], '', $base64Str)));
$task=new Task();
$res=$task->fileUpload($fileName);
return $res;
... ...