Skip to content

Commit

Permalink
feat: 页面过期修改
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaojingjing committed Jun 4, 2024
1 parent 09bb024 commit 80e2211
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
3 changes: 3 additions & 0 deletions packages/guard-core-v4/src/Guard/core/renderModule.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@ export const RenderModule: React.FC<{
<GuardInviteCompleteView key={key} />
),
[GuardModuleType.INVITE_EXPIRE]: key => <GuardInviteExpireView key={key} />,
[GuardModuleType.INVITE_PAGE_EXPIRE]: key => (
<GuardInviteExpireView key={key} />
),
[GuardModuleType.INVITE_SUCCESS]: key => (
<GuardInviteSuccessView key={key} />
)
Expand Down
1 change: 1 addition & 0 deletions packages/guard-core-v4/src/Guard/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export enum GuardModuleType {
INVITE_AUTH = 'inviteAuth',
INVITE_COMPLETE = 'inviteComplete',
INVITE_EXPIRE = 'inviteExpire', // 邀请链接过期
INVITE_PAGE_EXPIRE = 'invitePageExpire', // 页面过期
INVITE_SUCCESS = 'inviteSuccess' // 邀请成功
}
export interface GuardModuleAction {
Expand Down
8 changes: 6 additions & 2 deletions packages/guard-core-v4/src/Invitation/Error/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@ import { React } from 'shim-react'
import { GuardErrorView } from '../../Error'
import { i18n } from '../../_utils/locales'
import './style.less'
import { GuardModuleType } from '../../Guard'

export const GuardInviteExpireView = () => {
export const GuardInviteExpireView = (props: any) => {
return (
<GuardErrorView
error={{
name: 'invite_expire',
message: '当前邀请链接已失效,请联系相关管理员为你重新发起邀请。'
message:
props.key === GuardModuleType.INVITE_EXPIRE
? '当前邀请链接已失效,请联系相关管理员为你重新发起邀请。'
: '当前页面已过期,请重新点击邀请链接进入'
}}
/>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ export enum ApiCode {
TENANT_PORTAL = 1644,
SELECT_ACCOUNT_2_LOGIN = 2930,
RESET_ACCOUNT_NAME = 1108, // 用户名重复
INVITE_EXPIRE = 4032 // 链接过期
INVITE_EXPIRE = 4032, // 链接过期
INVITE_PAGE_EXPIRE = 4033
}

export const ChangeModuleApiCodeMapping: Record<string, GuardModuleType> = {
Expand All @@ -63,5 +64,6 @@ export const ChangeModuleApiCodeMapping: Record<string, GuardModuleType> = {
[ApiCode.FLOW_SELECT_ACCOUNT]: GuardModuleType.FLOW_SELECT_ACCOUNT,
[ApiCode.SELECT_ACCOUNT_2_LOGIN]: GuardModuleType.SELECT_ACCOUNT_2_LOGIN,
[ApiCode.TENANT_PORTAL]: GuardModuleType.TENANT_PORTAL,
[ApiCode.INVITE_EXPIRE]: GuardModuleType.INVITE_EXPIRE
[ApiCode.INVITE_EXPIRE]: GuardModuleType.INVITE_EXPIRE,
[ApiCode.INVITE_PAGE_EXPIRE]: GuardModuleType.INVITE_PAGE_EXPIRE
}

0 comments on commit 80e2211

Please sign in to comment.