mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2024-11-01 14:10:27 +08:00
修改上传路径
This commit is contained in:
parent
624b1ece67
commit
974d8f152a
@ -140,6 +140,7 @@ import { ElMessage } from "element-plus";
|
|||||||
import { useBaseStore } from "/$/base";
|
import { useBaseStore } from "/$/base";
|
||||||
import Draggable from "vuedraggable";
|
import Draggable from "vuedraggable";
|
||||||
import { fileSize, fileName } from "../utils";
|
import { fileSize, fileName } from "../utils";
|
||||||
|
import dayjs from "dayjs";
|
||||||
|
|
||||||
interface Item {
|
interface Item {
|
||||||
url: string;
|
url: string;
|
||||||
@ -315,7 +316,9 @@ async function httpRequest(req: any, item?: any) {
|
|||||||
if (mode == "local") {
|
if (mode == "local") {
|
||||||
data.append("key", fileName);
|
data.append("key", fileName);
|
||||||
} else {
|
} else {
|
||||||
fileName = props.prefixPath ? `${props.prefixPath}/${fileName}` : fileName;
|
fileName = [props.prefixPath, dayjs().format("YYYY-MM-DD"), fileName]
|
||||||
|
.filter(Boolean)
|
||||||
|
.join("/");
|
||||||
data.append("key", fileName);
|
data.append("key", fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user