feat: fix vite
This commit is contained in:
parent
b7cfbe3622
commit
47c50a52e3
25
index.html
25
index.html
@ -1,13 +1,16 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="zh">
|
<html lang="zh">
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8" />
|
<head>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta charset="UTF-8" />
|
||||||
<title>Center</title>
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<script src="https://kevisual.xiongxiao.me/system/lib/app.js"></script>
|
<title>Center</title>
|
||||||
</head>
|
<script src="https://kevisual.xiongxiao.me/root/system-lib/app.js"></script>
|
||||||
<body>
|
</head>
|
||||||
<div id="root"></div>
|
|
||||||
<script type="module" src="/src/main.tsx"></script>
|
<body>
|
||||||
</body>
|
<div id="root"></div>
|
||||||
</html>
|
<script type="module" src="/src/main.tsx"></script>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
@ -6,6 +6,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
|
"build:sky": "cross-env CENTER_ENV=sky vite build",
|
||||||
"dev:kv": "cross-env VITE_USE_KV=true vite",
|
"dev:kv": "cross-env VITE_USE_KV=true vite",
|
||||||
"lint": "eslint .",
|
"lint": "eslint .",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
|
@ -3,7 +3,7 @@ import 'nprogress/nprogress.css';
|
|||||||
import { Id, toast } from 'react-toastify';
|
import { Id, toast } from 'react-toastify';
|
||||||
import { nanoid } from 'nanoid';
|
import { nanoid } from 'nanoid';
|
||||||
import { toastLogin } from '@kevisual/resources/pages/message/ToastLogin';
|
import { toastLogin } from '@kevisual/resources/pages/message/ToastLogin';
|
||||||
import { uploadFiles, UploadProgress } from '@kevisual/query-upload/query-upload';
|
import { uploadFiles, UploadProgress } from '@kevisual/query-upload/query-upload.js';
|
||||||
|
|
||||||
export type ConvertOpts = {
|
export type ConvertOpts = {
|
||||||
appKey?: string;
|
appKey?: string;
|
||||||
|
17
pnpm-lock.yaml
generated
17
pnpm-lock.yaml
generated
@ -355,12 +355,18 @@ importers:
|
|||||||
'@mui/material':
|
'@mui/material':
|
||||||
specifier: ^7.0.1
|
specifier: ^7.0.1
|
||||||
version: 7.0.1(@emotion/react@11.14.0(@types/react@19.1.0)(react@19.1.0))(@emotion/styled@11.14.0(@emotion/react@11.14.0(@types/react@19.1.0)(react@19.1.0))(@types/react@19.1.0)(react@19.1.0))(@types/react@19.1.0)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)
|
version: 7.0.1(@emotion/react@11.14.0(@types/react@19.1.0)(react@19.1.0))(@emotion/styled@11.14.0(@emotion/react@11.14.0(@types/react@19.1.0)(react@19.1.0))(@types/react@19.1.0)(react@19.1.0))(@types/react@19.1.0)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)
|
||||||
|
re-resizable:
|
||||||
|
specifier: ^6.11.2
|
||||||
|
version: 6.11.2(react-dom@19.1.0(react@19.1.0))(react@19.1.0)
|
||||||
react:
|
react:
|
||||||
specifier: 19.1.0
|
specifier: 19.1.0
|
||||||
version: 19.1.0
|
version: 19.1.0
|
||||||
react-dom:
|
react-dom:
|
||||||
specifier: 19.1.0
|
specifier: 19.1.0
|
||||||
version: 19.1.0(react@19.1.0)
|
version: 19.1.0(react@19.1.0)
|
||||||
|
react-draggable:
|
||||||
|
specifier: ^4.4.6
|
||||||
|
version: 4.4.6(react-dom@19.1.0(react@19.1.0))(react@19.1.0)
|
||||||
react-hook-form:
|
react-hook-form:
|
||||||
specifier: ^7.55.0
|
specifier: ^7.55.0
|
||||||
version: 7.55.0(react@19.1.0)
|
version: 7.55.0(react@19.1.0)
|
||||||
@ -4381,6 +4387,12 @@ packages:
|
|||||||
react: '>=16.9.0'
|
react: '>=16.9.0'
|
||||||
react-dom: '>=16.9.0'
|
react-dom: '>=16.9.0'
|
||||||
|
|
||||||
|
re-resizable@6.11.2:
|
||||||
|
resolution: {integrity: sha512-2xI2P3OHs5qw7K0Ud1aLILK6MQxW50TcO+DetD9eIV58j84TqYeHoZcL9H4GXFXXIh7afhH8mv5iUCXII7OW7A==}
|
||||||
|
peerDependencies:
|
||||||
|
react: ^16.13.1 || ^17.0.0 || ^18.0.0 || ^19.0.0
|
||||||
|
react-dom: ^16.13.1 || ^17.0.0 || ^18.0.0 || ^19.0.0
|
||||||
|
|
||||||
react-datepicker@8.2.1:
|
react-datepicker@8.2.1:
|
||||||
resolution: {integrity: sha512-1pyALWM9mTZ7DG7tfcApwBy2kkld9Kz/EI++LhPnoXJAASbvuq6fdsDfkoB3q1JrxF7vhghVmQ759H/rOwUNNw==}
|
resolution: {integrity: sha512-1pyALWM9mTZ7DG7tfcApwBy2kkld9Kz/EI++LhPnoXJAASbvuq6fdsDfkoB3q1JrxF7vhghVmQ759H/rOwUNNw==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
@ -9220,6 +9232,11 @@ snapshots:
|
|||||||
react: 19.1.0
|
react: 19.1.0
|
||||||
react-dom: 19.1.0(react@19.1.0)
|
react-dom: 19.1.0(react@19.1.0)
|
||||||
|
|
||||||
|
re-resizable@6.11.2(react-dom@19.1.0(react@19.1.0))(react@19.1.0):
|
||||||
|
dependencies:
|
||||||
|
react: 19.1.0
|
||||||
|
react-dom: 19.1.0(react@19.1.0)
|
||||||
|
|
||||||
react-datepicker@8.2.1(react-dom@19.0.0(react@19.0.0))(react@19.0.0):
|
react-datepicker@8.2.1(react-dom@19.0.0(react@19.0.0))(react@19.0.0):
|
||||||
dependencies:
|
dependencies:
|
||||||
'@floating-ui/react': 0.27.5(react-dom@19.0.0(react@19.0.0))(react@19.0.0)
|
'@floating-ui/react': 0.27.5(react-dom@19.0.0(react@19.0.0))(react@19.0.0)
|
||||||
|
@ -1,3 +1,45 @@
|
|||||||
@import "./D-DIN/font.css";
|
@import 'tailwindcss';
|
||||||
@import "./Montserrat/font.css";
|
|
||||||
@import "./Orbitron/font.css";
|
@import './D-DIN/font.css';
|
||||||
|
@import './Montserrat/font.css';
|
||||||
|
@import './Orbitron/font.css';
|
||||||
|
|
||||||
|
/* D-DIN */
|
||||||
|
@utility font-d-din {
|
||||||
|
font-family: 'D-DIN', sans-serif;
|
||||||
|
}
|
||||||
|
@utility font-d-din-bold {
|
||||||
|
font-family: 'D-DIN-Bold', sans-serif;
|
||||||
|
}
|
||||||
|
@utility font-d-din-italic {
|
||||||
|
font-family: 'D-DIN-Italic', sans-serif;
|
||||||
|
}
|
||||||
|
@utility font-d-din-condensed {
|
||||||
|
font-family: 'D-DIN Condensed', sans-serif;
|
||||||
|
}
|
||||||
|
@utility font-d-din-condensed-bold {
|
||||||
|
font-family: 'D-DIN Condensed-Bold', sans-serif;
|
||||||
|
}
|
||||||
|
@utility font-d-din-exp {
|
||||||
|
font-family: 'D-DIN Exp', sans-serif;
|
||||||
|
}
|
||||||
|
@utility font-d-din-exp-italic {
|
||||||
|
font-family: 'D-DIN Exp-Italic', sans-serif;
|
||||||
|
}
|
||||||
|
@utility font-d-din-exp-bold {
|
||||||
|
font-family: 'D-DIN Exp-Bold', sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Montserrat */
|
||||||
|
@utility font-montserrat {
|
||||||
|
font-family: 'Montserrat', sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
@utility font-montserrat-italic {
|
||||||
|
font-family: 'Montserrat-Italic', sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Orbitron */
|
||||||
|
@utility font-orbitron {
|
||||||
|
font-family: 'Orbitron', sans-serif;
|
||||||
|
}
|
||||||
|
@ -1 +1,4 @@
|
|||||||
export const basename = DEV_SERVER ? '' : '/root/center';
|
export const basename = DEV_SERVER ? '' : '/root/center';
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
|
export const isSky = CENTER_ENV === 'sky';
|
||||||
|
@ -18,6 +18,7 @@ import { Languages, QrCode } from 'lucide-react';
|
|||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { toast } from 'react-toastify';
|
import { toast } from 'react-toastify';
|
||||||
import { useTheme } from '@kevisual/components/theme/index.tsx';
|
import { useTheme } from '@kevisual/components/theme/index.tsx';
|
||||||
|
import { isSky } from '../basename';
|
||||||
|
|
||||||
type LayoutMainProps = {
|
type LayoutMainProps = {
|
||||||
title?: React.ReactNode;
|
title?: React.ReactNode;
|
||||||
@ -112,15 +113,18 @@ export const LayoutMain = (props: LayoutMainProps) => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className='mr-4 flex gap-4 items-center no-drag'>
|
<div className='mr-4 flex gap-4 items-center no-drag'>
|
||||||
<div className='group relative'>
|
{!isSky && (
|
||||||
<IconButton>
|
<div className='group relative'>
|
||||||
<QrCode size={16} />
|
<IconButton>
|
||||||
</IconButton>
|
<QrCode size={16} />
|
||||||
<div className='absolute hidden group-hover:flex bg-white p-2 border shadow-md top-10 -left-15 w-40 z-[9999] flex-col items-center justify-center rounded-md'>
|
</IconButton>
|
||||||
<img src={QRCodePNG} alt='QR Code' />
|
|
||||||
<div className='text-sm text-black'>逸闻设计</div>
|
<div className='absolute hidden group-hover:flex bg-white p-2 border shadow-md top-10 -left-15 w-40 z-[9999] flex-col items-center justify-center rounded-md'>
|
||||||
|
<img src={QRCodePNG} alt='QR Code' />
|
||||||
|
<div className='text-sm text-black'>逸闻设计</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
)}
|
||||||
<div>
|
<div>
|
||||||
<Tooltip title={currentLanguage === 'en' ? 'English' : 'Chinese'}>
|
<Tooltip title={currentLanguage === 'en' ? 'English' : 'Chinese'}>
|
||||||
<IconButton onClick={handleClick} variant='contained'>
|
<IconButton onClick={handleClick} variant='contained'>
|
||||||
|
@ -39,8 +39,8 @@ export const FileUpload = forwardRef<any, Props>((props, ref) => {
|
|||||||
})) as any;
|
})) as any;
|
||||||
console.log('res', res);
|
console.log('res', res);
|
||||||
if (res?.code === 200) {
|
if (res?.code === 200) {
|
||||||
const resource = res.data?.resource;
|
const [resource] = res.data?.upload || {};
|
||||||
props?.onChange?.(resource);
|
props?.onChange?.(resource?.path || '');
|
||||||
} else {
|
} else {
|
||||||
message.error(res.message || 'Request failed');
|
message.error(res.message || 'Request failed');
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ import path from 'path';
|
|||||||
import tailwindcss from '@tailwindcss/vite';
|
import tailwindcss from '@tailwindcss/vite';
|
||||||
import basicSsl from '@vitejs/plugin-basic-ssl';
|
import basicSsl from '@vitejs/plugin-basic-ssl';
|
||||||
const isDev = process.env.NODE_ENV === 'development';
|
const isDev = process.env.NODE_ENV === 'development';
|
||||||
|
const centerEnv = process.env.CENTER_ENV;
|
||||||
const plugins: any[] = [basicSsl()];
|
const plugins: any[] = [basicSsl()];
|
||||||
plugins.push(tailwindcss());
|
plugins.push(tailwindcss());
|
||||||
const devBackend = 'https://kevisual.silkyai.cn';
|
const devBackend = 'https://kevisual.silkyai.cn';
|
||||||
@ -48,6 +49,7 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
define: {
|
define: {
|
||||||
DEV_SERVER: JSON.stringify(process.env.NODE_ENV === 'development'),
|
DEV_SERVER: JSON.stringify(process.env.NODE_ENV === 'development'),
|
||||||
|
CENTER_ENV: JSON.stringify(centerEnv),
|
||||||
},
|
},
|
||||||
base: isDev ? '/' : '/root/center/',
|
base: isDev ? '/' : '/root/center/',
|
||||||
build: {
|
build: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user