This commit is contained in:
archer
2023-07-25 21:53:26 +08:00
parent c5f50b65c9
commit b367082d38
25 changed files with 230 additions and 276 deletions

View File

@@ -10,6 +10,7 @@ import PageContainer from '@/components/PageContainer';
import SideTabs from '@/components/SideTabs';
import Tabs from '@/components/Tabs';
import UserInfo from './components/Info';
import { serviceSideProps } from '@/utils/i18n';
const BillTable = dynamic(() => import('./components/BillTable'), {
ssr: false
@@ -29,7 +30,7 @@ enum TabEnum {
'loginout' = 'loginout'
}
const NumberSetting = ({ currentTab }: { currentTab: `${TabEnum}` }) => {
const Account = ({ currentTab }: { currentTab: `${TabEnum}` }) => {
const tabList = useRef([
{ icon: 'meLight', label: '个人信息', id: TabEnum.info, Component: <BillTable /> },
{ icon: 'billRecordLight', label: '消费记录', id: TabEnum.bill, Component: <BillTable /> },
@@ -115,12 +116,13 @@ const NumberSetting = ({ currentTab }: { currentTab: `${TabEnum}` }) => {
);
};
export async function getServerSideProps({ query }: any) {
export async function getServerSideProps(content: any) {
return {
props: {
currentTab: query?.currentTab || TabEnum.info
currentTab: content?.query?.currentTab || TabEnum.info,
...(await serviceSideProps(content))
}
};
}
export default NumberSetting;
export default Account;

View File

@@ -14,6 +14,7 @@ import MyIcon from '@/components/Icon';
import PageContainer from '@/components/PageContainer';
import Loading from '@/components/Loading';
import BasicEdit from './components/BasicEdit';
import { serviceSideProps } from '@/utils/i18n';
const AdEdit = dynamic(() => import('./components/AdEdit'), {
ssr: false,
@@ -188,7 +189,7 @@ export async function getServerSideProps(context: any) {
const currentTab = context?.query?.currentTab || TabEnum.basicEdit;
return {
props: { currentTab }
props: { currentTab, ...(await serviceSideProps(context)) }
};
}

View File

@@ -16,17 +16,21 @@ import { AddIcon } from '@chakra-ui/icons';
import { delModelById } from '@/api/app';
import { useToast } from '@/hooks/useToast';
import { useConfirm } from '@/hooks/useConfirm';
import dynamic from 'next/dynamic';
import { serviceSideProps } from '@/utils/i18n';
import { useTranslation } from 'next-i18next';
import dynamic from 'next/dynamic';
import MyIcon from '@/components/Icon';
import PageContainer from '@/components/PageContainer';
import Avatar from '@/components/Avatar';
const CreateModal = dynamic(() => import('./component/CreateModal'));
import styles from './index.module.scss';
import MyTooltip from '@/components/MyTooltip';
const CreateModal = dynamic(() => import('./component/CreateModal'));
import styles from './index.module.scss';
const MyApps = () => {
const { toast } = useToast();
const { t } = useTranslation();
const theme = useTheme();
const router = useRouter();
const { myApps, loadMyModels } = useUserStore();
@@ -69,7 +73,7 @@ const MyApps = () => {
<PageContainer>
<Flex pt={3} px={5} alignItems={'center'}>
<Box flex={1} className="textlg" letterSpacing={1} fontSize={'24px'} fontWeight={'bold'}>
{t('app.My Apps')}
</Box>
<Button leftIcon={<AddIcon />} variant={'base'} onClick={onOpenCreateModal}>
@@ -167,4 +171,12 @@ const MyApps = () => {
);
};
export async function getServerSideProps(content: any) {
return {
props: {
...(await serviceSideProps(content))
}
};
}
export default MyApps;

View File

@@ -7,6 +7,7 @@ import type { ShareAppItem } from '@/types/app';
import { useUserStore } from '@/store/user';
import ShareModelList from './components/list';
import styles from './index.module.scss';
import { serviceSideProps } from '@/utils/i18n';
const modelList = () => {
const { Loading } = useLoading();
@@ -89,4 +90,12 @@ const modelList = () => {
);
};
export async function getServerSideProps(content: any) {
return {
props: {
...(await serviceSideProps(content))
}
};
}
export default modelList;

View File

@@ -17,6 +17,7 @@ import SideTabs from '@/components/SideTabs';
import PageContainer from '@/components/PageContainer';
import Avatar from '@/components/Avatar';
import Info from './components/Info';
import { serviceSideProps } from '@/utils/i18n';
const ImportData = dynamic(() => import('./components/Import'), {
ssr: false
@@ -159,7 +160,7 @@ export async function getServerSideProps(context: any) {
const kbId = context?.query?.kbId;
return {
props: { currentTab, kbId }
props: { currentTab, kbId, ...(await serviceSideProps(content)) }
};
}

View File

@@ -12,6 +12,7 @@ import { useRequest } from '@/hooks/useRequest';
import Avatar from '@/components/Avatar';
import MyIcon from '@/components/Icon';
import Tag from '@/components/Tag';
import { serviceSideProps } from '@/utils/i18n';
const Kb = () => {
const theme = useTheme();
@@ -156,4 +157,12 @@ const Kb = () => {
);
};
export async function getServerSideProps(content: any) {
return {
props: {
...(await serviceSideProps(content))
}
};
}
export default Kb;

View File

@@ -4,6 +4,7 @@ import { ChevronRightIcon } from '@chakra-ui/icons';
import MyIcon from '@/components/Icon';
import { useRouter } from 'next/router';
import { feConfigs } from '@/store/static';
import { serviceSideProps } from '@/utils/i18n';
const list = [
{
@@ -57,4 +58,12 @@ const Tools = () => {
);
};
export async function getServerSideProps(content: any) {
return {
props: {
...(await serviceSideProps(content))
}
};
}
export default Tools;