Skip to content

Commit

Permalink
fix: cesium ico logo
Browse files Browse the repository at this point in the history
  • Loading branch information
JerryHub-dev committed May 27, 2024
1 parent 5b43a58 commit acc3374
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 11 deletions.
18 changes: 17 additions & 1 deletion config/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { defineConfig } from '@umijs/max';
import path from 'path';
import { routes } from './routes';

export default defineConfig({
Expand All @@ -20,8 +21,22 @@ export default defineConfig({
to: 'dist/Cesium/Widgets',
},
],
chainWebpack(config) {
config.module
.rule('cesium')
.test(/\.js$/)
.include.add(path.resolve(__dirname, 'node_modules/cesium/Source'))
.end()
.use('strip-pragma-loader')
.loader('strip-pragma-loader')
.options({
pragmas: {
debug: false,
},
});
},
define: {
CESIUM_BASE_URL: '/Cesium',
CESIUM_BASE_URL: '/umi-react-admin/Cesium',
'process.env.CESIUM_ION_TOKEN':
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJkZjBmZTAzMS1jMTJkLTQ5OGQtYTkyYS0xODcyMjU3MTQzMmUiLCJpZCI6MTg2MDcxLCJpYXQiOjE3MDM0MDIwMzl9.DQzBf8T_0U92DwjBcYQqdgwhFs-Cx7EacplwoL_ypjY',
},
Expand All @@ -42,6 +57,7 @@ export default defineConfig({
styledComponents: {},
// 路由配置
routes,
favicons: ['/umi-react-admin/favicon.ico'],
npmClient: 'pnpm',
// 多语言配置 https://umijs.org/docs/max/i18n
locale: {
Expand Down
2 changes: 1 addition & 1 deletion src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const request: RequestConfig = requestConfig;
export const layout: RunTimeLayoutConfig = (initialState) => {
return {
title: 'React Admin',
logo: '/logo.svg',
logo: '/umi-react-admin/logo.svg',
// 默认布局调整
rightContentRender: () => <RightContent />,
menuHeaderRender: undefined,
Expand Down
18 changes: 9 additions & 9 deletions src/layouts/RightContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ const RightContent = () => {
title=""
trigger="hover"
placement="bottom"
className="flex justify-center items-center mr-5 "
className="flex items-center justify-center mr-5 "
content={
<div
className="hover:bg-zinc-200 py-1 px-2 rounded-md cursor-pointer w-24 text-center"
className="w-24 px-2 py-1 text-center rounded-md cursor-pointer hover:bg-zinc-200"
onClick={() => {
console.log('logout');
}}
Expand All @@ -64,13 +64,13 @@ const RightContent = () => {
}
>
<Avatar
className="w-7 h-7 bg-gray-300 flex justify-center items-center"
className="flex items-center justify-center bg-gray-300 w-7 h-7"
icon={<UserOutlined className="text-xl" />}
/>
<div className="ml-2">Admin</div>
</Popover>

<span className="rounded-lg border-2 h-7 mr-5" />
<span className="mr-5 border-2 rounded-lg h-7" />

{/* NOTE: 换肤 */}
<Popover
Expand All @@ -81,7 +81,7 @@ const RightContent = () => {
<div>
{themeType.map((item, index) => (
<div
className="hover:bg-zinc-200 py-1 px-2 rounded-md cursor-pointer w-24 text-center"
className="w-24 px-2 py-1 text-center rounded-md cursor-pointer hover:bg-zinc-200"
key={index}
onClick={() => {
messageApi.info(intl.formatMessage({ id: 'solution' }));
Expand All @@ -94,7 +94,7 @@ const RightContent = () => {
}
>
<Button
className="flex justify-center items-center"
className="flex items-center justify-center"
icon={<SkinOutlined />}
/>
</Popover>
Expand All @@ -108,7 +108,7 @@ const RightContent = () => {
<div>
{localeTypeData.map((item, index) => (
<div
className="hover:bg-zinc-200 py-1 px-2 rounded-md cursor-pointer w-24 text-center"
className="w-24 px-2 py-1 text-center rounded-md cursor-pointer hover:bg-zinc-200"
onClick={() => {
setLocale(item.value);
setLocaleType(item.value);
Expand All @@ -122,7 +122,7 @@ const RightContent = () => {
}
>
<Button
className="flex justify-center items-center"
className="flex items-center justify-center"
icon={<GlobalOutlined />}
/>
</Popover>
Expand All @@ -132,7 +132,7 @@ const RightContent = () => {
className="mr-6"
icon={<GithubOutlined />}
onClick={() => {
window.open('https://github.com/Jerry-0425/umi-react-admin');
window.open('https://github.com/JerryHub-dev/umi-react-admin');
}}
/>
</>
Expand Down

0 comments on commit acc3374

Please sign in to comment.