mirror of
https://github.com/PlayEdu/backend
synced 2025-06-17 19:58:33 +08:00
图片上传url检测
This commit is contained in:
parent
12cc5edbf6
commit
6010ac39d8
@ -2,7 +2,7 @@ import { Button, message, Modal } from "antd";
|
|||||||
import Dragger from "antd/es/upload/Dragger";
|
import Dragger from "antd/es/upload/Dragger";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import config from "../../../js/config";
|
import config from "../../../js/config";
|
||||||
import { getToken } from "../../../utils";
|
import { getToken, checkUrl } from "../../../utils";
|
||||||
import { InboxOutlined } from "@ant-design/icons";
|
import { InboxOutlined } from "@ant-design/icons";
|
||||||
|
|
||||||
interface PropsInterface {
|
interface PropsInterface {
|
||||||
@ -17,8 +17,8 @@ export const UploadImageSub = (props: PropsInterface) => {
|
|||||||
name: "file",
|
name: "file",
|
||||||
multiple: true,
|
multiple: true,
|
||||||
action:
|
action:
|
||||||
config.app_url +
|
checkUrl(config.app_url) +
|
||||||
"/backend/v1/upload/minio?category_ids=" +
|
"backend/v1/upload/minio?category_ids=" +
|
||||||
props.categoryIds.join(","),
|
props.categoryIds.join(","),
|
||||||
headers: {
|
headers: {
|
||||||
authorization: "Bearer " + getToken(),
|
authorization: "Bearer " + getToken(),
|
||||||
|
@ -124,3 +124,12 @@ export function ValidataCredentials(value: any) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function checkUrl(value: any) {
|
||||||
|
let url = value;
|
||||||
|
let str = url.substr(url.length - 1, 1);
|
||||||
|
if (str !== "/") {
|
||||||
|
url = url + "/";
|
||||||
|
}
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user