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
7afa8f00
authored
Oct 09, 2024
by
Finley Ge
Committed by
GitHub
Oct 09, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pref: trim the input of outlink (#2860)
parent
f6c5695d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
12 deletions
+44
-12
projects/app/src/pages/app/detail/components/Publish/FeiShu/FeiShuEditModal.tsx
+21
-7
projects/app/src/pages/app/detail/components/Publish/OffiAccount/OffiAccountEditModal.tsx
+23
-5
No files found.
projects/app/src/pages/app/detail/components/Publish/FeiShu/FeiShuEditModal.tsx
View file @
7afa8f00
import
React
from
'react'
;
import
React
from
'react'
;
import
{
Flex
,
Box
,
Button
,
Modal
Footer
,
ModalBody
,
Input
,
Link
,
Grid
}
from
'@chakra-ui/react'
;
import
{
Flex
,
Box
,
Button
,
Modal
Body
,
Input
,
Link
}
from
'@chakra-ui/react'
;
import
MyModal
from
'@fastgpt/web/components/common/MyModal'
;
import
MyModal
from
'@fastgpt/web/components/common/MyModal'
;
import
{
PublishChannelEnum
}
from
'@fastgpt/global/support/outLink/constant'
;
import
{
PublishChannelEnum
}
from
'@fastgpt/global/support/outLink/constant'
;
import
type
{
FeishuAppType
,
OutLinkEditType
}
from
'@fastgpt/global/support/outLink/type'
;
import
type
{
FeishuAppType
,
OutLinkEditType
}
from
'@fastgpt/global/support/outLink/type'
;
...
@@ -11,7 +11,6 @@ import BasicInfo from '../components/BasicInfo';
...
@@ -11,7 +11,6 @@ import BasicInfo from '../components/BasicInfo';
import
{
getDocPath
}
from
'@/web/common/system/doc'
;
import
{
getDocPath
}
from
'@/web/common/system/doc'
;
import
{
useSystemStore
}
from
'@/web/common/system/useSystemStore'
;
import
{
useSystemStore
}
from
'@/web/common/system/useSystemStore'
;
import
MyIcon
from
'@fastgpt/web/components/common/Icon'
;
import
MyIcon
from
'@fastgpt/web/components/common/Icon'
;
import
{
useSystem
}
from
'@fastgpt/web/hooks/useSystem'
;
import
FormLabel
from
'@fastgpt/web/components/common/MyBox/FormLabel'
;
import
FormLabel
from
'@fastgpt/web/components/common/MyBox/FormLabel'
;
const
FeiShuEditModal
=
({
const
FeiShuEditModal
=
({
...
@@ -39,11 +38,16 @@ const FeiShuEditModal = ({
...
@@ -39,11 +38,16 @@ const FeiShuEditModal = ({
});
});
const
{
runAsync
:
onclickCreate
,
loading
:
creating
}
=
useRequest2
(
const
{
runAsync
:
onclickCreate
,
loading
:
creating
}
=
useRequest2
(
(
e
)
=>
(
e
:
Omit
<
OutLinkEditType
<
FeishuAppType
>
,
'appId'
|
'type'
>
)
=>
createShareChat
({
createShareChat
({
...
e
,
...
e
,
appId
,
appId
,
type
:
PublishChannelEnum
.
feishu
type
:
PublishChannelEnum
.
feishu
,
app
:
{
appId
:
e
?.
app
?.
appId
?.
trim
(),
appSecret
:
e
.
app
?.
appSecret
?.
trim
(),
encryptKey
:
e
.
app
?.
encryptKey
?.
trim
()
}
}),
}),
{
{
errorToast
:
t
(
'common:common.Create Failed'
),
errorToast
:
t
(
'common:common.Create Failed'
),
...
@@ -52,14 +56,24 @@ const FeiShuEditModal = ({
...
@@ -52,14 +56,24 @@ const FeiShuEditModal = ({
}
}
);
);
const
{
runAsync
:
onclickUpdate
,
loading
:
updating
}
=
useRequest2
((
e
)
=>
updateShareChat
(
e
),
{
const
{
runAsync
:
onclickUpdate
,
loading
:
updating
}
=
useRequest2
(
(
e
)
=>
updateShareChat
({
...
e
,
app
:
{
appId
:
e
?.
app
?.
appId
?.
trim
(),
appSecret
:
e
.
app
?.
appSecret
?.
trim
(),
encryptKey
:
e
.
app
?.
encryptKey
?.
trim
()
}
}),
{
errorToast
:
t
(
'common:common.Update Failed'
),
errorToast
:
t
(
'common:common.Update Failed'
),
successToast
:
t
(
'common:common.Update Success'
),
successToast
:
t
(
'common:common.Update Success'
),
onSuccess
:
onEdit
onSuccess
:
onEdit
});
}
);
const
{
feConfigs
}
=
useSystemStore
();
const
{
feConfigs
}
=
useSystemStore
();
const
{
isPc
}
=
useSystem
();
return
(
return
(
<
MyModal
<
MyModal
...
...
projects/app/src/pages/app/detail/components/Publish/OffiAccount/OffiAccountEditModal.tsx
View file @
7afa8f00
...
@@ -38,12 +38,19 @@ const OffiAccountEditModal = ({
...
@@ -38,12 +38,19 @@ const OffiAccountEditModal = ({
});
});
const
{
runAsync
:
onclickCreate
,
loading
:
creating
}
=
useRequest2
(
const
{
runAsync
:
onclickCreate
,
loading
:
creating
}
=
useRequest2
(
(
e
)
=>
(
e
:
OutLinkEditType
<
OffiAccountAppType
>
)
=>
{
createShareChat
({
if
(
e
?.
app
)
{
e
.
app
.
appId
=
e
.
app
.
appId
?.
trim
();
e
.
app
.
secret
=
e
.
app
.
secret
?.
trim
();
e
.
app
.
CallbackToken
=
e
.
app
.
CallbackToken
?.
trim
();
e
.
app
.
CallbackEncodingAesKey
=
e
.
app
.
CallbackEncodingAesKey
?.
trim
();
}
return
createShareChat
({
...
e
,
...
e
,
appId
,
appId
,
type
:
PublishChannelEnum
.
officialAccount
type
:
PublishChannelEnum
.
officialAccount
}),
});
},
{
{
errorToast
:
t
(
'common:common.Create Failed'
),
errorToast
:
t
(
'common:common.Create Failed'
),
successToast
:
t
(
'common:common.Create Success'
),
successToast
:
t
(
'common:common.Create Success'
),
...
@@ -51,11 +58,22 @@ const OffiAccountEditModal = ({
...
@@ -51,11 +58,22 @@ const OffiAccountEditModal = ({
}
}
);
);
const
{
runAsync
:
onclickUpdate
,
loading
:
updating
}
=
useRequest2
((
e
)
=>
updateShareChat
(
e
),
{
const
{
runAsync
:
onclickUpdate
,
loading
:
updating
}
=
useRequest2
(
(
e
)
=>
{
if
(
e
?.
app
)
{
e
.
app
.
appId
=
e
.
app
.
appId
?.
trim
();
e
.
app
.
secret
=
e
.
app
.
secret
?.
trim
();
e
.
app
.
CallbackToken
=
e
.
app
.
CallbackToken
?.
trim
();
e
.
app
.
CallbackEncodingAesKey
=
e
.
app
.
CallbackEncodingAesKey
?.
trim
();
}
return
updateShareChat
(
e
);
},
{
errorToast
:
t
(
'common:common.Update Failed'
),
errorToast
:
t
(
'common:common.Update Failed'
),
successToast
:
t
(
'common:common.Update Success'
),
successToast
:
t
(
'common:common.Update Success'
),
onSuccess
:
onEdit
onSuccess
:
onEdit
});
}
);
const
{
feConfigs
}
=
useSystemStore
();
const
{
feConfigs
}
=
useSystemStore
();
...
...
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