diff --git a/ui/config-overrides.js b/ui/config-overrides.js index a1c4dce4..e80ec653 100644 --- a/ui/config-overrides.js +++ b/ui/config-overrides.js @@ -26,6 +26,7 @@ module.exports = { const config = configFunction(proxy, allowedHost); config.proxy = { '/answer': { + // target: "http://10.0.20.84:8080", target: 'http://10.0.10.98:2060', changeOrigin: true, secure: false, diff --git a/ui/package.json b/ui/package.json index 1185f9d5..38e4b291 100644 --- a/ui/package.json +++ b/ui/package.json @@ -46,7 +46,7 @@ "react": "^18.2.0", "react-bootstrap": "^2.5.0", "react-dom": "^18.2.0", - "react-helmet": "^6.1.0", + "react-helmet-async": "^1.3.0", "react-i18next": "^11.18.3", "react-router-dom": "^6.4.0", "swr": "^1.3.0", @@ -108,4 +108,4 @@ "pnpm": ">=7" }, "license": "MIT" -} +} \ No newline at end of file diff --git a/ui/pnpm-lock.yaml b/ui/pnpm-lock.yaml index c6bfcd1e..22d75f0e 100644 --- a/ui/pnpm-lock.yaml +++ b/ui/pnpm-lock.yaml @@ -67,7 +67,7 @@ specifiers: react-app-rewired: ^2.2.1 react-bootstrap: ^2.5.0 react-dom: ^18.2.0 - react-helmet: ^6.1.0 + react-helmet-async: ^1.3.0 react-i18next: ^11.18.3 react-router-dom: ^6.4.0 react-scripts: 5.0.1 @@ -102,7 +102,7 @@ dependencies: react: 18.2.0 react-bootstrap: 2.5.0_7ey2zzynotv32rpkwno45fsx4e react-dom: 18.2.0_react@18.2.0 - react-helmet: 6.1.0_react@18.2.0 + react-helmet-async: 1.3.0_biqbaboplfbrettd7655fr4n2y react-i18next: 11.18.6_ulhmqqxshznzmtuvahdi5nasbq react-router-dom: 6.4.0_biqbaboplfbrettd7655fr4n2y swr: 1.3.0_react@18.2.0 @@ -9581,16 +9581,19 @@ packages: resolution: {integrity: sha512-rtGImPZ0YyLrscKI9xTpV8psd6I8VAtjKCzQDlzyDvqJA8XOW78TXYQwNRNd8g8JZnDu8q9Fu/1v4HPAVwVdHA==} dev: false - /react-helmet/6.1.0_react@18.2.0: - resolution: {integrity: sha512-4uMzEY9nlDlgxr61NL3XbKRy1hEkXmKNXhjbAIOVw5vcFrsdYbH2FEwcNyWvWinl103nXgzYNlns9ca+8kFiWw==} + /react-helmet-async/1.3.0_biqbaboplfbrettd7655fr4n2y: + resolution: {integrity: sha512-9jZ57/dAn9t3q6hneQS0wukqC2ENOBgMNVEhb/ZG9ZSxUetzVIw4iAmEU38IaVg3QGYauQPhSeUTuIUtFglWpg==} peerDependencies: - react: '>=16.3.0' + react: ^16.6.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.6.0 || ^17.0.0 || ^18.0.0 dependencies: - object-assign: 4.1.1 + '@babel/runtime': 7.19.0 + invariant: 2.2.4 prop-types: 15.8.1 react: 18.2.0 + react-dom: 18.2.0_react@18.2.0 react-fast-compare: 3.2.0 - react-side-effect: 2.1.2_react@18.2.0 + shallowequal: 1.1.0 dev: false /react-i18next/11.18.6_ulhmqqxshznzmtuvahdi5nasbq: @@ -9747,14 +9750,6 @@ packages: - webpack-hot-middleware - webpack-plugin-serve - /react-side-effect/2.1.2_react@18.2.0: - resolution: {integrity: sha512-PVjOcvVOyIILrYoyGEpDN3vmYNLdy1CajSFNt4TDsVQC5KpTijDvWVoR+/7Rz2xT978D8/ZtFceXxzsPwZEDvw==} - peerDependencies: - react: ^16.3.0 || ^17.0.0 || ^18.0.0 - dependencies: - react: 18.2.0 - dev: false - /react-transition-group/4.4.5_biqbaboplfbrettd7655fr4n2y: resolution: {integrity: sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==} peerDependencies: @@ -10257,6 +10252,10 @@ packages: /setprototypeof/1.2.0: resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==} + /shallowequal/1.1.0: + resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} + dev: false + /shebang-command/2.0.0: resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} engines: {node: '>=8'} diff --git a/ui/src/common/interface.ts b/ui/src/common/interface.ts index 4838588c..daf17261 100644 --- a/ui/src/common/interface.ts +++ b/ui/src/common/interface.ts @@ -80,7 +80,7 @@ export interface RegisterReqParams extends LoginReqParams { name: string; } -export interface ModifyPassReq { +export interface ModifyPasswordReq { old_pass: string; pass: string; } @@ -137,7 +137,7 @@ export interface ImgCodeRes { verify: boolean; } -export interface PssRetReq extends ImgCodeReq { +export interface PasswordResetReq extends ImgCodeReq { e_mail: string; } @@ -145,11 +145,11 @@ export interface CheckImgReq { action: 'login' | 'e_mail' | 'find_pass'; } -export interface NoticeSetReq { +export interface SetNoticeReq { notice_switch: boolean; } -export interface QuDetailRes { +export interface QuestionDetailRes { id: string; title: string; content: string; diff --git a/ui/src/components/BaseUserCard/index.tsx b/ui/src/components/BaseUserCard/index.tsx index a5278ebc..58e7f313 100644 --- a/ui/src/components/BaseUserCard/index.tsx +++ b/ui/src/components/BaseUserCard/index.tsx @@ -5,23 +5,35 @@ import { Avatar } from '@answer/components'; interface Props { data: any; + showAvatar?: boolean; avatarSize?: string; className?: string; } const Index: FC = ({ data, + showAvatar = true, avatarSize = '20px', className = 'fs-14', }) => { return (
- - - - - {data?.display_name} - + {data.status !== 'deleted' ? ( + + {showAvatar && ( + + )} + {data?.display_name} + + ) : ( + <> + {showAvatar && ( + + )} + {data?.display_name} + + )} + {data?.rank}
); diff --git a/ui/src/components/Comment/components/ActionBar/index.tsx b/ui/src/components/Comment/components/ActionBar/index.tsx index 041bd97b..7fee20f1 100644 --- a/ui/src/components/Comment/components/ActionBar/index.tsx +++ b/ui/src/components/Comment/components/ActionBar/index.tsx @@ -17,15 +17,20 @@ const ActionBar = ({ onReply, onVote, onAction, + userStatus = '', }) => { const { t } = useTranslation('translation', { keyPrefix: 'comment' }); return (
-
- {nickName} - - +
+ {userStatus !== 'deleted' ? ( + {nickName} + ) : ( + {nickName} + )} + +