fix: route url

This commit is contained in:
chenos 2024-08-18 17:24:01 +08:00
parent de595019ba
commit d94a054c01
2 changed files with 13 additions and 12 deletions

View File

@ -7,14 +7,14 @@
* For more information, please refer to: https://www.nocobase.com/agreement.
*/
import React, { FC, useState } from 'react';
import { QRCode, Popover, Button } from 'antd';
import { QrcodeOutlined } from '@ant-design/icons';
import { Button, Popover, QRCode } from 'antd';
import React, { FC, useState } from 'react';
import { CustomIconComponentProps } from '@ant-design/icons/lib/components/Icon';
import { css, DesignableSwitch, Icon, useApp } from '@nocobase/client';
import { usePluginTranslation } from '../locale';
import { useSize } from './sizeContext';
import { css, DesignableSwitch, Icon } from '@nocobase/client';
import { CustomIconComponentProps } from '@ant-design/icons/lib/components/Icon';
const PadSvg = () => (
<svg
@ -58,6 +58,7 @@ const MobileIcon = (props: Partial<CustomIconComponentProps>) => <Icon type={''}
export const DesktopModeHeader: FC = () => {
const { t } = usePluginTranslation();
const app = useApp();
const { setSize } = useSize();
const [open, setOpen] = useState(false);
const handleQrcodeOpen = (newOpen: boolean) => {
@ -93,7 +94,7 @@ export const DesktopModeHeader: FC = () => {
}
`}
>
<Button style={{ color: 'white' }} href="/admin">
<Button style={{ color: 'white' }} href={app.getRouteUrl('/admin')}>
{t('Back')}
</Button>
<div style={{ display: 'flex', alignItems: 'center' }}>

View File

@ -7,19 +7,19 @@
* For more information, please refer to: https://www.nocobase.com/agreement.
*/
import React, { FC, useCallback } from 'react';
import { SafeArea } from 'antd-mobile';
import 'antd-mobile/es/components/tab-bar/tab-bar.css';
import React, { FC, useCallback } from 'react';
import { Navigate } from 'react-router-dom';
import { useStyles } from './styles';
import { useMobileRoutes } from '../../mobile-providers';
import { useStyles } from './styles';
import { getMobileTabBarItemSchema, MobileTabBarItem } from './MobileTabBar.Item';
import { MobileTabBarPage, MobileTabBarLink } from './types';
import { cx, DndContext, DndContextProps, SchemaComponent, useDesignable, css, useApp } from '@nocobase/client';
import { MobileTabBarInitializer } from './initializer';
import { css, cx, DndContext, DndContextProps, SchemaComponent, useApp, useDesignable } from '@nocobase/client';
import { isInnerLink } from '../../utils';
import { MobileTabBarInitializer } from './initializer';
import { getMobileTabBarItemSchema, MobileTabBarItem } from './MobileTabBar.Item';
import { MobileTabBarLink, MobileTabBarPage } from './types';
export interface MobileTabBarProps {
/**
@ -57,7 +57,7 @@ export const MobileTabBar: FC<MobileTabBarProps> & {
);
if (!hasAuth) {
return <Navigate to="/admin" />;
return <Navigate to={app.getRouteUrl('/admin')} />;
}
if (!enableTabBar) {