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