feat: 修复打包报错问题

This commit is contained in:
landaiqing
2024-07-13 00:06:43 +08:00
parent 6ec4a92853
commit 4a3809e959
9 changed files with 22 additions and 23 deletions

View File

@@ -13,7 +13,7 @@ const props: any = {
multiple: true, multiple: true,
directory: true, directory: true,
action: "https://660d2bd96ddfa2943b33731c.mockapi.io/api/upload", action: "https://660d2bd96ddfa2943b33731c.mockapi.io/api/upload",
onChange(info) { onChange(info: any) {
const { status } = info.file; const { status } = info.file;
if (status !== "uploading") { if (status !== "uploading") {
console.log(info.file, info.fileList); console.log(info.file, info.fileList);
@@ -24,7 +24,7 @@ const props: any = {
message.error(`${info.file.name} file upload failed.`); message.error(`${info.file.name} file upload failed.`);
} }
}, },
onDrop(e) { onDrop(e: any) {
console.log("Dropped files", e.dataTransfer.files); console.log("Dropped files", e.dataTransfer.files);
}, },
}; };

View File

@@ -259,7 +259,7 @@ const File: FunctionComponent = () => {
</Flex> </Flex>
<Input <Input
value={store.getFilePath().join("/")} value={store.getFilePath().join("/")}
style={{ marginLeft: 15}} style={{ marginLeft: 15 }}
/> />
</Flex> </Flex>
<Flex <Flex
@@ -469,7 +469,6 @@ const File: FunctionComponent = () => {
</div> </div>
<FloatButton <FloatButton
trigger="click"
type="primary" type="primary"
style={{ right: "5%" }} style={{ right: "5%" }}
icon={<CloudUploadOutlined />} icon={<CloudUploadOutlined />}

View File

@@ -1,7 +1,6 @@
/** @format */ /** @format */
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from "react";
import { Avatar, Card, Flex, Skeleton, Space, Tag } from "antd"; import { Avatar, Card, Flex, Skeleton, Space, Tag } from "antd";
import Meta from "antd/es/card/Meta";
import styles from "./index.module.less"; import styles from "./index.module.less";
import ReactECharts from "echarts-for-react"; import ReactECharts from "echarts-for-react";
import { ProCard, ProList } from "@ant-design/pro-components"; import { ProCard, ProList } from "@ant-design/pro-components";

View File

@@ -103,6 +103,8 @@ const columns: ProColumns<AwsOssConfigItem>[] = [
title: "操作", title: "操作",
valueType: "option", valueType: "option",
key: "option", key: "option",
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
render: (text: ReactNode, record: AwsOssConfigItem, _, action: any) => [ render: (text: ReactNode, record: AwsOssConfigItem, _, action: any) => [
<a <a
key="editable" key="editable"

View File

@@ -85,6 +85,8 @@ const columns: ProColumns<BaiduOssConfigItem>[] = [
title: "操作", title: "操作",
valueType: "option", valueType: "option",
key: "option", key: "option",
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
render: (text: ReactNode, record: BaiduOssConfigItem, _, action: any) => [ render: (text: ReactNode, record: BaiduOssConfigItem, _, action: any) => [
<a <a
key="editable" key="editable"

View File

@@ -29,7 +29,7 @@ const ShareAdd: React.FunctionComponent = () => {
enable: true, enable: true,
items: ["ai", "Bold", "Italic", "Underline", "Strike", "code", "comment"], items: ["ai", "Bold", "Italic", "Underline", "Strike", "code", "comment"],
}, },
onChange: async (value) => { onChange: async (value: any) => {
fromRef.current.setFieldsValue({ fromRef.current.setFieldsValue({
content: value.getHtml(), content: value.getHtml(),
}); });

View File

@@ -8,15 +8,14 @@ import { useNavigate } from "react-router-dom";
import TextArea from "antd/es/input/TextArea"; import TextArea from "antd/es/input/TextArea";
import { EyeOutlined, PlusOutlined, UnorderedListOutlined } from "@ant-design/icons"; import { EyeOutlined, PlusOutlined, UnorderedListOutlined } from "@ant-design/icons";
import pic from "@/assets/images/background.png"; import pic from "@/assets/images/background.png";
import pic2 from "@/assets/images/setting.png";
import Meta from "antd/es/card/Meta"; import Meta from "antd/es/card/Meta";
const MainShare: FunctionComponent = () => { const MainShare: FunctionComponent = () => {
const navigate = useNavigate(); const navigate = useNavigate();
const [open, setOpen] = useState(false); const [open, setOpen] = useState(false);
const showDrawer = () => { // const showDrawer = () => {
setOpen(true); // setOpen(true);
}; // };
const onClose = () => { const onClose = () => {
setOpen(false); setOpen(false);
@@ -150,8 +149,7 @@ const MainShare: FunctionComponent = () => {
</Form> </Form>
</Drawer> </Drawer>
<FloatButton <FloatButton
trigger="click" type={"primary"}
type="primary"
style={{ right: "5%", width: 50, height: 50 }} style={{ right: "5%", width: 50, height: 50 }}
icon={<PlusOutlined />} icon={<PlusOutlined />}
onClick={() => setOpen(true)} onClick={() => setOpen(true)}

View File

@@ -1,7 +1,7 @@
/** @format */ /** @format */
import matchAuth from "./matchRouter.ts"; import matchAuth from "./matchRouter.ts";
import { Navigate, useLocation } from "react-router-dom"; import { Navigate, useLocation } from "react-router-dom";
import { message } from "antd"; // import { message } from "antd";
import { getStorageFromKey } from "@/utils/localStorage/config.ts"; import { getStorageFromKey } from "@/utils/localStorage/config.ts";
import React from "react"; import React from "react";
export default function AuthRoute(props: { children: React.ReactNode }) { export default function AuthRoute(props: { children: React.ReactNode }) {
@@ -32,14 +32,14 @@ export default function AuthRoute(props: { children: React.ReactNode }) {
return <Navigate to="/404" />; return <Navigate to="/404" />;
} }
if (!isLogin) { // if (!isLogin) {
message // message
.open({ // .open({
content: "请先登录!", // content: "请先登录!",
type: "warning", // type: "warning",
}) // })
.then(); // .then();
return <Navigate to="/login" />; // return <Navigate to="/login" />;
} // }
return props.children; return props.children;
} }

View File

@@ -142,7 +142,6 @@ export default defineConfig(({ mode }): any => {
"@ant-design/icons", "@ant-design/icons",
"@ant-design/pro-components", "@ant-design/pro-components",
"@ant-design/use-emotion-css", "@ant-design/use-emotion-css",
"@ant-design/charts",
], ],
}, },
}, },