import { defRequest } from '@/utils/request' enum Api { Licenses = '/licenses', } /** * @description: 前端调用上传固定许可文件接口 * @yapi: * @author: chens * @date: 2023/07/17 */ export function uploadLicenseApi(file: string | Blob) { const _formData = new FormData() _formData.append('flowFile', file) return defRequest.post({ headers: { Authorization: '', 'Content-Type': 'multipart/form-data', }, url: `${Api.Licenses}/html-backend/upload-license`, data: _formData, }) } /** * @description: 前端调用获取设备码接口 * @yapi: * @author: chens * @date: 2023/07/17 */ export function getMachineCodeApi() { return defRequest.get({ headers: { Authorization: '' }, url: `${Api.Licenses}/fore-end/machine-code`, }) } /** * @description: 连接许可服务接口(连接许可服务,验证浮动许可) * @yapi: * @author: chens * @date: 2023/07/17 */ export function uploadCiphertextApi(licenseStr: string) { return defRequest.post({ headers: { Authorization: '' }, url: `${Api.Licenses}/html-backend/upload-ciphertext`, data: { licenseStr }, }) } /** * @description: 获取许可信息 * @yapi: * @author: chens * @date: 2023/07/17 */ export function getLicenseTnformationApi() { return defRequest.get({ headers: { Authorization: '' }, url: `${Api.Licenses}/info`, }) }