Merge branch 'feat/1.1.2/ui' of github.com:answerdev/answer into feat/1.1.2/ui

This commit is contained in:
shuai
2023-04-21 14:22:32 +08:00
4 changed files with 20 additions and 1 deletions
+6
View File
@@ -1,19 +1,25 @@
import { memo } from 'react';
import { Container, Col } from 'react-bootstrap';
import { useSearchParams } from 'react-router-dom';
import { useTranslation } from 'react-i18next';
import { userCenterStore } from '@/stores';
import { USER_AGENT_NAMES } from '@/common/constants';
import { usePageTags } from '@/hooks';
import WeComAuth from './components/WeCom';
const Index = () => {
const { t } = useTranslation('translation');
const [searchParam] = useSearchParams();
const { agent: ucAgent } = userCenterStore();
let agentName = ucAgent?.agent_info.name || '';
if (searchParam.get('agent_name')) {
agentName = searchParam.get('agent_name') || '';
}
usePageTags({
title: t('login', { keyPrefix: 'page_title' }),
});
return (
<Container style={{ paddingTop: '5rem', paddingBottom: '5rem' }}>
<Col md={4} className="mx-auto">
@@ -1,19 +1,25 @@
import { memo } from 'react';
import { Container } from 'react-bootstrap';
import { useSearchParams } from 'react-router-dom';
import { useTranslation } from 'react-i18next';
import { userCenterStore } from '@/stores';
import { USER_AGENT_NAMES } from '@/common/constants';
import { usePageTags } from '@/hooks';
import WeCom from './components/WeCom';
const Index = () => {
const { t } = useTranslation('translation');
const [searchParam] = useSearchParams();
const { agent: ucAgent } = userCenterStore();
let agentName = ucAgent?.agent_info.name || '';
if (searchParam.get('agent_name')) {
agentName = searchParam.get('agent_name') || '';
}
usePageTags({
title: t('login', { keyPrefix: 'page_title' }),
});
return (
<Container>
{USER_AGENT_NAMES.WeCom.toLowerCase() === agentName.toLowerCase() ? (
+3 -1
View File
@@ -33,7 +33,9 @@ const pageTags = create<HelmetStore>((set) => ({
o.pageTitle = makePageTitle(params.title, params.subtitle);
}
o.description =
params.description || siteInfoStore.getState().siteInfo.description;
params.description ||
siteInfoStore.getState().siteInfo?.description ||
'';
o.keywords = params.keywords || '';
set({
+5
View File
@@ -9,6 +9,7 @@ import {
themeSettingStore,
seoSettingStore,
loginToContinueStore,
pageTagStore,
} from '@/stores';
import { RouteAlias } from '@/router/alias';
import {
@@ -373,6 +374,10 @@ export const initAppSettingsStore = async () => {
.updateVersion(appSettings.version, appSettings.revision);
siteInfoStore.getState().updateUsers(appSettings.site_users);
interfaceStore.getState().update(appSettings.interface);
pageTagStore.getState().update({
title: appSettings.general?.name,
description: appSettings.general?.description,
});
brandingStore.getState().update(appSettings.branding);
loginSettingStore.getState().update(appSettings.login);
customizeStore.getState().update(appSettings.custom_css_html);