修复安装时模板引用报错问题,

添加二维码图片上传功能,可以支持远程图片地址和生成二维码图片。
This commit is contained in:
技术老胡
2024-12-04 12:02:35 +08:00
parent 16513960ad
commit 40f07d9023
7 changed files with 209 additions and 17 deletions

View File

@@ -143,7 +143,22 @@ class PayManageController extends BaseController
unlink($path);
}
}
// 上传二维码图片
public function uploadQrcode()
{
$img = $this->request->file('codeimg');
$path = public_path() . '/files/qrcode/';
if (!is_dir($path)) {
mkdir($path, 0777, true);
}
$info = $img->move($path, 'img' . time() . '.' . $img->getOriginalExtension());
if ($info) {
$imgpath = '/files/qrcode/';
return json(backMsg(0, '上传成功', ['imgpath' => $imgpath . $info->getFilename()]));
} else {
return json(backMsg(1, '上传失败'));
}
}
// 生成账号配置
private function createAccountConfig($acc)
{