@@ -2,8 +2,6 @@ import { FormInput, messageInstance, PasswordInput } from "lowcoder-design";
2
2
import {
3
3
AuthBottomView ,
4
4
ConfirmButton ,
5
- FormWrapperMobile ,
6
- LoginCardTitle ,
7
5
StyledRouteLink ,
8
6
} from "pages/userAuth/authComponents" ;
9
7
import React , { useContext , useEffect , useState } from "react" ;
@@ -15,7 +13,7 @@ import { UserConnectionSource } from "@lowcoder-ee/constants/userConstants";
15
13
import { trans } from "i18n" ;
16
14
import { AuthContext , useAuthSubmit } from "pages/userAuth/authUtils" ;
17
15
import { ThirdPartyAuth } from "pages/userAuth/thirdParty/thirdPartyAuth" ;
18
- import { AUTH_FORGOT_PASSWORD_URL , AUTH_REGISTER_URL , ORG_AUTH_FORGOT_PASSWORD_URL , ORG_AUTH_REGISTER_URL } from "constants/routesURL" ;
16
+ import { AUTH_FORGOT_PASSWORD_URL , AUTH_REGISTER_URL } from "constants/routesURL" ;
19
17
import { Link , useLocation , useParams } from "react-router-dom" ;
20
18
import { Divider } from "antd" ;
21
19
import Flex from "antd/es/flex" ;
@@ -27,7 +25,6 @@ import LeftOutlined from "@ant-design/icons/LeftOutlined";
27
25
import { fetchConfigAction } from "@lowcoder-ee/redux/reduxActions/configActions" ;
28
26
import { useDispatch , useSelector } from "react-redux" ;
29
27
import history from "util/history" ;
30
- import ApplicationApi from "@lowcoder-ee/api/applicationApi" ;
31
28
import { getServerSettings } from "@lowcoder-ee/redux/selectors/applicationSelector" ;
32
29
import { fetchOrgPaginationByEmail } from "@lowcoder-ee/util/pagination/axios" ;
33
30
import PaginationComp from "@lowcoder-ee/util/pagination/Pagination" ;
@@ -120,9 +117,10 @@ export default function FormLoginSteps(props: FormLoginProps) {
120
117
const serverSettings = useSelector ( getServerSettings ) ;
121
118
const [ elements , setElements ] = useState < ElementsState > ( { elements : [ ] , total : 0 } ) ;
122
119
const [ currentPage , setCurrentPage ] = useState ( 1 ) ;
123
- const [ pageSize , setPageSize ] = useState ( 2 ) ;
120
+ const [ pageSize , setPageSize ] = useState ( 10 ) ;
124
121
125
122
useEffect ( ( ) => {
123
+ if ( account )
126
124
fetchOrgPaginationByEmail ( {
127
125
email : account ,
128
126
pageNum : currentPage ,
@@ -169,20 +167,25 @@ export default function FormLoginSteps(props: FormLoginProps) {
169
167
}
170
168
171
169
setOrgLoading ( true ) ;
172
- OrgApi . fetchOrgsByEmail ( account )
170
+ fetchOrgPaginationByEmail ( {
171
+ email : account ,
172
+ pageNum : currentPage ,
173
+ pageSize : pageSize
174
+ } )
173
175
. then ( ( resp ) => {
174
- if ( validateResponse ( resp ) ) {
175
- setOrgList ( resp . data . data ) ;
176
- if ( ! resp . data . data . length ) {
176
+ if ( resp . success ) {
177
+ setElements ( { elements : resp . data || [ ] , total : resp . total || 1 } )
178
+ setOrgList ( resp . data ) ;
179
+ if ( ! resp . data . length ) {
177
180
history . push (
178
181
AUTH_REGISTER_URL ,
179
182
{ ...location . state || { } , email : account } ,
180
183
)
181
184
return ;
182
185
}
183
- if ( resp . data . data . length === 1 ) {
184
- setOrganizationId ( resp . data . data [ 0 ] . orgId ) ;
185
- dispatch ( fetchConfigAction ( resp . data . data [ 0 ] . orgId ) ) ;
186
+ if ( resp . data . length === 1 ) {
187
+ setOrganizationId ( resp . data [ 0 ] . orgId ) ;
188
+ dispatch ( fetchConfigAction ( resp . data [ 0 ] . orgId ) ) ;
186
189
setCurrentStep ( CurrentStepEnum . AUTH_PROVIDERS ) ;
187
190
return ;
188
191
}
0 commit comments