mirror of
https://github.com/CodePhiliaX/Chat2DB.git
synced 2025-09-27 09:03:16 +08:00
umi 环境变量
This commit is contained in:
@ -45,6 +45,8 @@ export default defineConfig({
|
|||||||
headScripts: ['if (window.myAPI) { window.myAPI.startServerForSpawn() }'],
|
headScripts: ['if (window.myAPI) { window.myAPI.startServerForSpawn() }'],
|
||||||
favicons: ['logo.ico'],
|
favicons: ['logo.ico'],
|
||||||
define: {
|
define: {
|
||||||
'process.env.UMI_ENV': process.env.UMI_ENV,
|
'process.env': {
|
||||||
|
'UMI_ENV': process.env.UMI_ENV
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -69,8 +69,7 @@
|
|||||||
"productName": "Chat2DB",
|
"productName": "Chat2DB",
|
||||||
"asar": false,
|
"asar": false,
|
||||||
"files": [
|
"files": [
|
||||||
"dist/**/*",
|
"dist/",
|
||||||
"!node_modules",
|
|
||||||
"static/",
|
"static/",
|
||||||
"src/main",
|
"src/main",
|
||||||
"package.json"
|
"package.json"
|
||||||
|
@ -3,31 +3,31 @@ import classnames from 'classnames';
|
|||||||
// import desktopStyle from './desktop.less';
|
// import desktopStyle from './desktop.less';
|
||||||
import styles from './index.less';
|
import styles from './index.less';
|
||||||
|
|
||||||
// let container = ''
|
let container = '';
|
||||||
// container = `
|
|
||||||
// @font-face {
|
|
||||||
// font-family: 'iconfont'; /* Project id 3633546 */
|
|
||||||
// src: url('../../assets/font/iconfont.woff2') format('woff2'),
|
|
||||||
// url('../../assets/font/iconfont.woff') format('woff'),
|
|
||||||
// url('../../assets/font/iconfont.ttf') format('truetype');
|
|
||||||
// }
|
|
||||||
// `
|
|
||||||
|
|
||||||
// if (process.env.UMI_ENV === 'desktop') {
|
if (process.env.UMI_ENV === 'desktop') {
|
||||||
// } else {
|
container = `
|
||||||
// container = `
|
@font-face {
|
||||||
// @font-face {
|
font-family: 'iconfont'; /* Project id 3633546 */
|
||||||
// font-family: 'iconfont'; /* Project id 3633546 */
|
src: url('../../assets/font/iconfont.woff2') format('woff2'),
|
||||||
// src: url('//at.alicdn.com/t/c/font_3633546_bobs6jadiya.woff2?t=1687102726036') format('woff2'),
|
url('../../assets/font/iconfont.woff') format('woff'),
|
||||||
// url('//at.alicdn.com/t/c/font_3633546_bobs6jadiya.woff?t=1687102726036') format('woff'),
|
url('../../assets/font/iconfont.ttf') format('truetype');
|
||||||
// url('//at.alicdn.com/t/c/font_3633546_bobs6jadiya.ttf?t=1687102726036') format('truetype');
|
}
|
||||||
// }
|
`
|
||||||
// `
|
} else {
|
||||||
// }
|
container = `
|
||||||
// let style = document.createElement("style");
|
@font-face {
|
||||||
// style.type = "text/css";
|
font-family: 'iconfont'; /* Project id 3633546 */
|
||||||
// document.head.appendChild(style);
|
src: url('//at.alicdn.com/t/c/font_3633546_bobs6jadiya.woff2?t=1687102726036') format('woff2'),
|
||||||
// style.appendChild(document.createTextNode(container));
|
url('//at.alicdn.com/t/c/font_3633546_bobs6jadiya.woff?t=1687102726036') format('woff'),
|
||||||
|
url('//at.alicdn.com/t/c/font_3633546_bobs6jadiya.ttf?t=1687102726036') format('truetype');
|
||||||
|
}
|
||||||
|
`
|
||||||
|
}
|
||||||
|
let style = document.createElement("style");
|
||||||
|
style.type = "text/css";
|
||||||
|
document.head.appendChild(style);
|
||||||
|
style.appendChild(document.createTextNode(container));
|
||||||
|
|
||||||
export default class Iconfont extends PureComponent<{
|
export default class Iconfont extends PureComponent<{
|
||||||
code: string;
|
code: string;
|
||||||
|
@ -33,6 +33,7 @@ declare global {
|
|||||||
const __ENV: string;
|
const __ENV: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window._ENV = process.env.UMI_ENV! || 'local';
|
||||||
window._Lang = getLang();
|
window._Lang = getLang();
|
||||||
|
|
||||||
const { getDesignToken, useToken } = theme;
|
const { getDesignToken, useToken } = theme;
|
||||||
|
Reference in New Issue
Block a user