首页页面完善

This commit is contained in:
2024-02-03 19:51:36 +08:00
parent 486ea5013a
commit 82b09c68a5
34 changed files with 1060 additions and 73 deletions

View File

@@ -2,11 +2,13 @@
* 通用接口
*/
import type { SendCodeParams, SendCodeResult, UploadImageResult } from './types';
import { post, upload } from '@/utils/request';
import { get, post, upload } from '@/utils/request';
enum URL {
upload = '/common/upload',
sendCode = '/sendCode',
barCode = '/ext2/qr/barimg',
qrCode = '/ext2/qr/qrimg'
}
// 图片上传
@@ -15,3 +17,12 @@ export const uploadImage = (imagePath: string) =>
// 发送验证码
export const sendCode = (data: SendCodeParams) => post<SendCodeResult>({ url: URL.sendCode, data });
export const generateBarCode = (data: string) => get<ArrayBuffer>({
url: `${URL.barCode}?v=${data}`,
responseType: 'arraybuffer'
});
export const generateQrCode = (data: string) => get<ArrayBuffer>({
url: `${URL.qrCode}?v=${data}`,
responseType: 'arraybuffer'
});