From f27ca082eb0a839449dd50c49007b58e5ed6946f Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Thu, 19 Jun 2025 19:08:01 +0800
Subject: [PATCH] feat: 服务名修改
---
src/utils/common.ts | 31 ++++++++++++++++++++++++++++++-
1 files changed, 30 insertions(+), 1 deletions(-)
diff --git a/src/utils/common.ts b/src/utils/common.ts
index 03c65f2..c0e1549 100644
--- a/src/utils/common.ts
+++ b/src/utils/common.ts
@@ -1,8 +1,37 @@
+/*
+ * @Author: GuLiMmo 2820890765@qq.com
+ * @Date: 2024-03-12 17:59:03
+ * @LastEditors: GuLiMmo 2820890765@qq.com
+ * @LastEditTime: 2024-08-27 16:52:42
+ * @FilePath: /drone-web/src/utils/common.ts
+ * @Description:
+ * Copyright (c) 2024 by GuLiMmo, All Rights Reserved.
+ */
-export function downloadFile (data: Blob, fileName: string) {
+import { validatenull } from './validate'
+
+/**
+ * 下载文件
+ * @param data
+ * @param fileName
+ */
+export const downloadFile = (data: Blob, fileName: string) => {
const lable = document.createElement('a')
lable.href = window.URL.createObjectURL(data)
lable.download = fileName
lable.click()
URL.revokeObjectURL(lable.href)
}
+
+// 表单序列化
+export const serialize = (data: { [x: string]: any }) => {
+ const list: string[] = []
+ Object.keys(data).forEach((ele) => {
+ list.push(`${ele}=${data[ele]}`)
+ })
+ return list.join('&')
+}
+
+export const requireImg = (path: string) => {
+ return new URL(`/src/assets/${path}`, import.meta.url).href
+}
--
Gitblit v1.9.3