Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵月辉
/
fastgpt-migrated
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
8151350d
authored
Jul 22, 2023
by
archer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: register
parent
32395346
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
33 additions
and
9 deletions
+33
-9
client/src/components/ChatBox/index.tsx
+20
-2
client/src/pages/_app.tsx
+3
-3
client/src/pages/app/detail/index.tsx
+5
-4
client/src/pages/login/components/ForgetPasswordForm.tsx
+1
-0
client/src/pages/login/components/RegisterForm.tsx
+1
-0
client/src/utils/tools.ts
+3
-0
No files found.
client/src/components/ChatBox/index.tsx
View file @
8151350d
...
...
@@ -11,7 +11,13 @@ import React, {
import
{
throttle
}
from
'lodash'
;
import
{
ChatItemType
,
ChatSiteItemType
,
ExportChatType
}
from
'@/types/chat'
;
import
{
useToast
}
from
'@/hooks/useToast'
;
import
{
useCopyData
,
voiceBroadcast
,
hasVoiceApi
,
getErrText
}
from
'@/utils/tools'
;
import
{
useCopyData
,
voiceBroadcast
,
cancelBroadcast
,
hasVoiceApi
,
getErrText
}
from
'@/utils/tools'
;
import
{
Box
,
Card
,
Flex
,
Input
,
Textarea
,
Button
,
useTheme
}
from
'@chakra-ui/react'
;
import
{
useUserStore
}
from
'@/store/user'
;
import
{
feConfigs
}
from
'@/store/static'
;
...
...
@@ -387,7 +393,6 @@ const ChatBox = (
zIndex
:
1
,
w
:
'100%'
};
console
.
log
(
ChatBoxRef
.
current
?.
clientWidth
);
const
messageCardMaxW
=
[
'calc(100% - 48px)'
,
'calc(100% - 65px)'
];
...
...
@@ -404,9 +409,22 @@ const ChatBox = (
useEffect
(()
=>
{
return
()
=>
{
controller
.
current
?.
abort
();
// close voice
cancelBroadcast
();
};
},
[
router
.
query
]);
useEffect
(()
=>
{
const
listen
=
()
=>
{
cancelBroadcast
();
};
window
.
addEventListener
(
'beforeunload'
,
listen
);
return
()
=>
{
window
.
removeEventListener
(
'beforeunload'
,
listen
);
};
},
[]);
return
(
<
Flex
flexDirection=
{
'column'
}
h=
{
'100%'
}
>
<
Box
...
...
client/src/pages/_app.tsx
View file @
8151350d
...
...
@@ -35,9 +35,9 @@ function App({ Component, pageProps, isPc }: AppProps & { isPc?: boolean; respon
const
[
baiduTongji
,
setBaiduTongji
]
=
useState
<
string
>
();
const
{
initIsPc
}
=
useGlobalStore
();
if
(
isPc
!==
undefined
)
{
initIsPc
(
isPc
);
}
//
if (isPc !== undefined) {
//
initIsPc(isPc);
//
}
useEffect
(()
=>
{
(
async
()
=>
{
...
...
client/src/pages/app/detail/index.tsx
View file @
8151350d
...
...
@@ -64,16 +64,17 @@ const AppDetail = ({ currentTab }: { currentTab: `${TabEnum}` }) => {
);
useEffect
(()
=>
{
window
.
onbeforeunload
=
const
listen
=
process
.
env
.
NODE_ENV
===
'production'
?
(
e
)
=>
{
?
(
e
:
any
)
=>
{
e
.
preventDefault
();
e
.
returnValue
=
'内容已修改,确认离开页面吗?'
;
}
:
null
;
:
()
=>
{};
window
.
addEventListener
(
'beforeunload'
,
listen
);
return
()
=>
{
window
.
onbeforeunload
=
null
;
window
.
removeEventListener
(
'beforeunload'
,
listen
)
;
clearAppModules
();
};
},
[]);
...
...
client/src/pages/login/components/ForgetPasswordForm.tsx
View file @
8151350d
...
...
@@ -6,6 +6,7 @@ import { postFindPassword } from '@/api/user';
import
{
useSendCode
}
from
'@/hooks/useSendCode'
;
import
type
{
ResLogin
}
from
'@/api/response/user'
;
import
{
useToast
}
from
'@/hooks/useToast'
;
import
{
feConfigs
}
from
'@/store/static'
;
interface
Props
{
setPageType
:
Dispatch
<
`
${
PageTypeEnum
}
`
>
;
...
...
client/src/pages/login/components/RegisterForm.tsx
View file @
8151350d
...
...
@@ -9,6 +9,7 @@ import { useToast } from '@/hooks/useToast';
import
{
useRouter
}
from
'next/router'
;
import
{
postCreateApp
}
from
'@/api/app'
;
import
{
appTemplates
}
from
'@/constants/flow/ModuleTemplate'
;
import
{
feConfigs
}
from
'@/store/static'
;
interface
Props
{
loginSuccess
:
(
e
:
ResLogin
)
=>
void
;
...
...
client/src/utils/tools.ts
View file @
8151350d
...
...
@@ -114,6 +114,9 @@ export const voiceBroadcast = ({ text }: { text: string }) => {
cancel
:
()
=>
window
.
speechSynthesis
?.
cancel
()
};
};
export
const
cancelBroadcast
=
()
=>
{
window
.
speechSynthesis
?.
cancel
();
};
export
const
getErrText
=
(
err
:
any
,
def
=
''
)
=>
{
const
msg
:
string
=
typeof
err
===
'string'
?
err
:
err
?.
message
||
def
||
''
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment