You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@answer.apache.org by sh...@apache.org on 2024/05/27 09:40:02 UTC
(incubator-answer) branch test updated (389d8551 -> ef61261b)
This is an automated email from the ASF dual-hosted git repository.
shuai pushed a change to branch test
in repository https://gitbox.apache.org/repos/asf/incubator-answer.git
from 389d8551 fix(user): remove user center log
new 8604c428 fix: update translations
new ef61261b fix: path exception when adding basepath
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
i18n/en_US.yaml | 2 +-
i18n/zh_CN.yaml | 2 +-
ui/src/pages/Install/components/FifthStep/index.tsx | 10 +++-------
.../pages/Users/Settings/Account/components/MyLogins/index.tsx | 6 +++++-
ui/src/utils/floppyNavigation.ts | 2 +-
ui/src/utils/request.ts | 2 ++
6 files changed, 13 insertions(+), 11 deletions(-)
(incubator-answer) 02/02: fix: path exception when adding basepath
Posted by sh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
shuai pushed a commit to branch test
in repository https://gitbox.apache.org/repos/asf/incubator-answer.git
commit ef61261b460f5fa26d6597e96582b63b61d8709e
Author: shuai <li...@sifou.com>
AuthorDate: Mon May 27 17:37:53 2024 +0800
fix: path exception when adding basepath
---
ui/src/pages/Install/components/FifthStep/index.tsx | 10 +++-------
.../pages/Users/Settings/Account/components/MyLogins/index.tsx | 6 +++++-
ui/src/utils/floppyNavigation.ts | 2 +-
ui/src/utils/request.ts | 2 ++
4 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/ui/src/pages/Install/components/FifthStep/index.tsx b/ui/src/pages/Install/components/FifthStep/index.tsx
index 4ec99a5c..7a9061f9 100644
--- a/ui/src/pages/Install/components/FifthStep/index.tsx
+++ b/ui/src/pages/Install/components/FifthStep/index.tsx
@@ -21,7 +21,6 @@ import { FC } from 'react';
import { Button } from 'react-bootstrap';
import { useTranslation, Trans } from 'react-i18next';
-import { REACT_BASE_PATH } from '@/router/alias';
import Progress from '../Progress';
interface Props {
@@ -38,18 +37,15 @@ const Index: FC<Props> = ({ visible, siteUrl = '' }) => {
<p>
<Trans i18nKey="install.ready_description">
If you ever feel like changing more settings, visit
- <a href={`${siteUrl}${REACT_BASE_PATH}/users/login`}>
- {' '}
- admin section
- </a>
- ; find it in the site menu.
+ <a href={`${siteUrl}/users/login`}> admin section</a>; find it in the
+ site menu.
</Trans>
</p>
<p>{t('good_luck')}</p>
<div className="d-flex align-items-center justify-content-between">
<Progress step={5} />
- <Button href={`${siteUrl}${REACT_BASE_PATH}`}>{t('done')}</Button>
+ <Button href={siteUrl}>{t('done')}</Button>
</div>
</div>
);
diff --git a/ui/src/pages/Users/Settings/Account/components/MyLogins/index.tsx b/ui/src/pages/Users/Settings/Account/components/MyLogins/index.tsx
index 353115f1..cd545d58 100644
--- a/ui/src/pages/Users/Settings/Account/components/MyLogins/index.tsx
+++ b/ui/src/pages/Users/Settings/Account/components/MyLogins/index.tsx
@@ -27,6 +27,7 @@ import { useToast } from '@/hooks';
import { base64ToSvg } from '@/utils';
import Storage from '@/utils/storage';
import { REDIRECT_PATH_STORAGE_KEY } from '@/common/constants';
+import { REACT_BASE_PATH } from '@/router/alias';
const Index = () => {
const { data, mutate } = useOauthConnectorInfoByUser();
@@ -42,7 +43,10 @@ const Index = () => {
const deleteLogins = (e, item) => {
if (!item.binding) {
- Storage.set(REDIRECT_PATH_STORAGE_KEY, window.location.pathname);
+ Storage.set(
+ REDIRECT_PATH_STORAGE_KEY,
+ window.location.pathname.replace(REACT_BASE_PATH, ''),
+ );
return;
}
e.preventDefault();
diff --git a/ui/src/utils/floppyNavigation.ts b/ui/src/utils/floppyNavigation.ts
index 69ba4e88..9bdf7fd4 100644
--- a/ui/src/utils/floppyNavigation.ts
+++ b/ui/src/utils/floppyNavigation.ts
@@ -75,7 +75,7 @@ const storageLoginRedirect = () => {
const { pathname } = window.location;
if (pathname !== RouteAlias.login && pathname !== RouteAlias.signUp) {
const loc = window.location;
- const redirectUrl = loc.href.replace(loc.origin, '');
+ const redirectUrl = loc.href.replace(`${loc.origin}${REACT_BASE_PATH}`, '');
Storage.set(REDIRECT_PATH_STORAGE_KEY, redirectUrl);
}
};
diff --git a/ui/src/utils/request.ts b/ui/src/utils/request.ts
index 48f50e6e..c4070957 100644
--- a/ui/src/utils/request.ts
+++ b/ui/src/utils/request.ts
@@ -31,6 +31,8 @@ import { floppyNavigation } from './floppyNavigation';
import { isIgnoredPath, IGNORE_PATH_LIST } from './guard';
const baseConfig = {
+ baseURL:
+ process.env.NODE_ENV === 'development' ? '' : process.env.REACT_APP_API_URL,
timeout: 10000,
withCredentials: true,
};
(incubator-answer) 01/02: fix: update translations
Posted by sh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
shuai pushed a commit to branch test
in repository https://gitbox.apache.org/repos/asf/incubator-answer.git
commit 8604c4281cc90712581da6a0f403053a69a8bb63
Author: shuai <li...@sifou.com>
AuthorDate: Mon May 27 11:45:13 2024 +0800
fix: update translations
---
i18n/en_US.yaml | 2 +-
i18n/zh_CN.yaml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/i18n/en_US.yaml b/i18n/en_US.yaml
index e6ce9b48..e08092f4 100644
--- a/i18n/en_US.yaml
+++ b/i18n/en_US.yaml
@@ -1462,7 +1462,7 @@ ui:
title: Admin
dashboard:
title: Dashboard
- welcome: Welcome to Answer Admin!
+ welcome: Welcome to {{site_name}} Admin!
site_statistics: Site statistics
questions: "Questions:"
answers: "Answers:"
diff --git a/i18n/zh_CN.yaml b/i18n/zh_CN.yaml
index f92974ad..22df91c6 100644
--- a/i18n/zh_CN.yaml
+++ b/i18n/zh_CN.yaml
@@ -1411,7 +1411,7 @@ ui:
title: 后台管理
dashboard:
title: 后台管理
- welcome: 欢迎来到 Answer 后台管理!
+ welcome: 欢迎来到 {{site_name}} 后台管理!
site_statistics: 站点统计
questions: "问题:"
answers: "回答:"