From 03c275439949875a857538df89a41696642c42b3 Mon Sep 17 00:00:00 2001
From: zhangwei <1504152376@qq.com>
Date: 星期一, 01 九月 2025 17:15:39 +0800
Subject: [PATCH] '首页公告与详情'

---
 src/api/upload/index.ts |   59 +++++++++++++++++++++++++++++++++--------------------------
 1 files changed, 33 insertions(+), 26 deletions(-)

diff --git a/src/api/upload/index.ts b/src/api/upload/index.ts
index 8fb1139..0855e0e 100644
--- a/src/api/upload/index.ts
+++ b/src/api/upload/index.ts
@@ -2,37 +2,44 @@
  * 锛堜笉寤鸿鍐欐垚 request.post(xxx)锛屽洜涓鸿繖鏍� post 鏃讹紝鏃犳硶 params 涓� data 鍚屾椂浼犲弬锛�
  *
  * 涓婁紶api鎺ュ彛闆嗗悎
- * @method register 娉ㄥ唽
- * @method captcha 鑾峰彇楠岃瘉鐮�
  */
 
 import { http } from "@/utils/http";
-import { baseUrlApi } from "../util";
-type Result = {
-  success: boolean;
-  data: Array<any>;
+import { baseUrlApi, uploadUrlApi } from "../util";
+import type { Result, getUploadTokenResult } from "../types";
+
+// 鑾峰彇涓婁紶Token
+export const getUploadToken = () => {
+  return http.request<getUploadTokenResult>(
+    "get",
+    baseUrlApi("/api/upFile/token")
+  );
 };
 
-//涓婁紶鍜岃瘑鍒惀涓氭墽鐓�
-export const upBizLicense = (data?: object) => {
-  return http.request("post", baseUrlApi("/api/upFile/upBizLicense"), { data });
-};
-
-export const captcha = () => {
-  return http.request<Result>("get", baseUrlApi("/api/zCSMS/captcha"));
-};
-
-//鑾峰彇瑙掕壊
-export const exRole = () => {
-  return http.request<Result>("get", baseUrlApi("/api/customer/exRole"));
-};
-
-// 鑾峰彇鎵嬫満楠岃瘉鐮�
-export const phoneNumberCode = (params?: object) => {
-  return http.request(
+export const uploadFileAli11 = (data, key) => {
+  return http.request<Result>(
     "post",
-    baseUrlApi(
-      `/api/zCSMS/sendSMS/${params.phone}/${params.code}/${params.codeId}`
-    )
+    uploadUrlApi(`/${key}`),
+    { data },
+    {
+      headers: {
+        "Content-Type": "multipart/form-data", // 璁剧疆鍐呭绫诲瀷涓� multipart/form-data锛岃繖瀵逛簬鏂囦欢涓婁紶鏄繀椤荤殑
+        "Access-Control-Allow-Origin": "*"
+      }
+    }
+  );
+};
+
+export const uploadFileAli = (data, url) => {
+  return http.request<Result>(
+    "post",
+    `${url}`,
+    { data },
+    {
+      headers: {
+        "Content-Type": "multipart/form-data", // 璁剧疆鍐呭绫诲瀷涓� multipart/form-data锛岃繖瀵逛簬鏂囦欢涓婁紶鏄繀椤荤殑
+        "Access-Control-Allow-Origin": "*"
+      }
+    }
   );
 };

--
Gitblit v1.9.1