diff --git a/src/components/CorrectionModal/CorrectionModal.tsx b/src/components/CorrectionModal/CorrectionModal.tsx index 8fa83cf..05c3206 100644 --- a/src/components/CorrectionModal/CorrectionModal.tsx +++ b/src/components/CorrectionModal/CorrectionModal.tsx @@ -5,7 +5,9 @@ import { Form, Select, Button, Upload, message, Input, Modal, Table, Empty } fro import type { TableColumnsType } from 'antd'; const { Search } = Input; import { UploadOutlined } from '@ant-design/icons'; -import { DevUserId, get, post, uploadFileUrl } from "../../util/AjaxUtils.ts"; +import { + // DevUserId + get, post, uploadFileUrl } from "../../util/AjaxUtils.ts"; // import { getMenuActive } from '../../util/cache.ts' import { useDispatch } from 'react-redux' const { TextArea } = Input; @@ -17,6 +19,7 @@ interface DataType { projId: string } export default function CorrectionModal(props: any) { + const token = sessionStorage.getItem('token') const columns: TableColumnsType = [ { title: '序号', @@ -369,7 +372,8 @@ export default function CorrectionModal(props: any) { { const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png' || file.type === 'application/pdf'; // const isPdf = file.type === 'application/pdf'; diff --git a/src/components/LoginPage/LoginPage.tsx b/src/components/LoginPage/LoginPage.tsx index 0cb1c2a..85e7083 100644 --- a/src/components/LoginPage/LoginPage.tsx +++ b/src/components/LoginPage/LoginPage.tsx @@ -17,7 +17,10 @@ import { // import { useParams } from "react-router-dom"; import { useEffect, useState } from "react"; // import { DevUserId, get, downloadUrl, put, uploadImageUrl, post } from "../../../util/AjaxUtils.ts"; -import { DevUserId, get, downloadUrl, put, uploadImageUrl, post } from "../../util/AjaxUtils.ts"; +import { + // DevUserId, + get, downloadUrl, put, uploadImageUrl, post +} from "../../util/AjaxUtils.ts"; import { Button, Form } from 'antd'; // import CardImgSelect, { } from "../../../components/card/CardImgSelect.tsx"; import CardImgSelect, { } from "../../components/card/CardImgSelect.tsx"; @@ -36,6 +39,7 @@ type FormFieldType = { type FileType = Parameters>[0]; export default function ProjConfigLoginpage(props: any) { + const token = sessionStorage.getItem('token') // const nav = useNavigate(); // const pathParams = useParams(); const [messageApi, contextHolder] = message.useMessage(); @@ -329,7 +333,8 @@ export default function ProjConfigLoginpage(props: any) { maxCount={1} defaultFileList={logoImgArray} action={uploadImageUrl()} - headers={{ 'X-USER-ID': DevUserId }} + // headers={{ 'X-USER-ID': DevUserId }} + headers={{ 'Auth': `Bearer ${token}` }} beforeUpload={beforeUpload} onChange={(info) => { if (info.file.status === 'uploading') { @@ -386,7 +391,8 @@ export default function ProjConfigLoginpage(props: any) { maxCount={1} defaultFileList={bgImgArray} action={uploadImageUrl()} - headers={{ 'X-USER-ID': DevUserId }} + // headers={{ 'X-USER-ID': DevUserId }} + headers={{ 'Auth': `Bearer ${token}` }} beforeUpload={beforeUpload} onChange={(info) => { if (info.file.status === 'uploading') { diff --git a/src/components/LoginPageShow/LoginPageShow.tsx b/src/components/LoginPageShow/LoginPageShow.tsx index 9bbe0b4..694a48b 100644 --- a/src/components/LoginPageShow/LoginPageShow.tsx +++ b/src/components/LoginPageShow/LoginPageShow.tsx @@ -16,8 +16,10 @@ import { } from "antd"; // import { useParams } from "react-router-dom"; import { useEffect, useState } from "react"; -import { DevUserId, get, downloadUrl, put, uploadImageUrl, post } from "../../util/AjaxUtils.ts"; -import { Form } from 'antd'; +import { + // DevUserId, + get, downloadUrl, put, uploadImageUrl, post } from "../../util/AjaxUtils.ts"; +import { Form } from 'antd'; import CardImgSelect, { } from "../../components/card/CardImgSelect.tsx"; type FormFieldType = { @@ -33,7 +35,8 @@ type FormFieldType = { type FileType = Parameters>[0]; -export default function ProjConfigLoginpage(props:any) { +export default function ProjConfigLoginpage(props: any) { + const token = sessionStorage.getItem('token') // const nav = useNavigate(); // const pathParams = useParams(); const [messageApi, contextHolder] = message.useMessage(); @@ -150,7 +153,7 @@ export default function ProjConfigLoginpage(props:any) { if (data.loginpageId) { upLoginPage(data.loginpageId) - }else{ + } else { getlistLoginpage(); } } @@ -169,7 +172,7 @@ export default function ProjConfigLoginpage(props:any) { {title: '登录界面设置'}, ]} /> */} -
+
@@ -182,8 +185,8 @@ export default function ProjConfigLoginpage(props:any) { // background: 'pink', marginTop: '18px' }} /> -
- {/*