shaogen1995 2 年 前
コミット
34df618c29

+ 2 - 2
src/pages/A1Project/A1Inner/index.tsx

@@ -20,7 +20,7 @@ import A1IRemove from "./A1IRemove";
 import A1ILack from "./A1ILack";
 import A1IAudit from "./A1IAudit";
 import A1IupFile from "./A1IupFile";
-import { baseURL } from "@/utils/http";
+import { baseUpUrl } from "@/utils/http";
 import { A2Tab2Type } from "@/types/api/A2Dict";
 import AuthCom from "@/components/AuthCom";
 
@@ -416,7 +416,7 @@ function A1Inner({ projectId, myTitle, projectName }: Props) {
 
       {upFileOpen ? (
         <A1IupFile
-          myUrl={`${baseURL}cms/inside/upload/${projectId}`}
+          myUrl={`${baseUpUrl}cms/inside/upload/${projectId}`}
           upFileFu={() => getListFu()}
           closeFu={() => setUpFileOpen(false)}
           myTitle={myTitle}

+ 2 - 2
src/pages/A1Project/A1Outer/index.tsx

@@ -8,7 +8,7 @@ import React, {
 import styles from "./index.module.scss";
 import { Button, Input, Popconfirm, Table } from "antd";
 import classNames from "classnames";
-import { baseURL } from "@/utils/http";
+import { baseUpUrl } from "@/utils/http";
 import A1ORenFile from "./A1ORenFile";
 import A1OMove from "./A1OMove";
 import { A1OFileType } from "@/types";
@@ -402,7 +402,7 @@ function A1Outer({ projectId, projectName }: Props) {
       {/* 点击批量上传 */}
       {upFileId ? (
         <A1OupFile
-          myUrl={baseURL + "cms/item/upload"}
+          myUrl={baseUpUrl + "cms/item/upload"}
           fromData={{ parentId: upFileId, projectId }}
           nowLoc={nowLoc.txt}
           closeFu={() => setUpFileId(0)}

+ 3 - 3
src/utils/authFilesLook.ts

@@ -1,5 +1,5 @@
 import store from "@/store";
-import { baseURL } from "./http";
+import { baseUpUrl } from "./http";
 import { getTokenFu } from "./storage";
 
 // 携带token,转换成文件流
@@ -13,12 +13,12 @@ export const urlChangeFu = (
 
   let xhr = new XMLHttpRequest();
 
-  xhr.open("get", baseURL + url, true);
+  xhr.open("get", baseUpUrl.replace("api/", "api") + url, true);
 
   xhr.responseType = "blob";
   xhr.onload = function (res) {
     if (this.status === 200) {
-      var blob = this.response;
+      let blob = this.response;
 
       // 转为为Blob格式的
       const srcRes = window.URL.createObjectURL(blob);

+ 2 - 0
src/utils/http.ts

@@ -22,6 +22,8 @@ declare module "axios" {
   }
 }
 
+export const baseUpUrl = baseURL + "/api/";
+
 // 创建 axios 实例
 const http = axios.create({
   // --------线下的地址不用加/api/