Skip to content
This repository was archived by the owner on Aug 12, 2025. It is now read-only.

Commit dbc7b2b

Browse files
committed
feat: update fastlogin
1 parent 7af1cf7 commit dbc7b2b

File tree

5 files changed

+14
-9
lines changed

5 files changed

+14
-9
lines changed

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,15 @@
2929
"eslint-plugin-prettier": "^3.1.3",
3030
"eslint-plugin-react": "^7.19.0",
3131
"eslint-plugin-react-hooks": "^2.5.0",
32-
"lerna": "^2.11.0",
32+
"lerna": "^3.22.1",
3333
"prettier": "^2.0.5",
3434
"typescript": "^3.9.3"
3535
},
3636
"dependencies": {
3737
"@alicloud/console-base-rc-messenger-region": "^1.1.2"
38+
},
39+
"resolutions": {
40+
"@types/react": "^16.0.0",
41+
"@types/react-dom": "^16.0.0"
3842
}
3943
}

packages/console-utils/fastlogin/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,14 @@ const open = async (options: IFastLoginOptions) => {
5151

5252
const render = async (options: IFastLoginOptions) => {
5353
const fastLogin = await loadFastLoginScripts(options);
54-
const { height = 700, width = 500 } = options
54+
const { height = 782, width = 512 } = options
5555
return new Promise<ILoginCallbackProps>((resolve, reject) => {
5656
fastLogin('render', [{
5757
target: options.target,
5858
// @ts-ignore
5959
type: "one_login", // one_login, password, qr
6060
custom: {
61+
pageChangeMode: "none",
6162
footerComs: ['third-party']
6263
},
6364
loginCallback: (result) => {

packages/console-utils/fastlogin/stories/index.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as React from 'react';
22
import ReactDOM from 'react-dom';
33
import { storiesOf } from '@storybook/react';
4-
import { open, unmount } from '../src';
4+
import { open, render, unmount } from '../src';
55

66
window.React = React;
77
window.ReactDOM = ReactDOM;
@@ -10,7 +10,7 @@ storiesOf('FastLogin', module)
1010
.add('FastLogin', () => {
1111
const onClick = async () => {
1212
try {
13-
const result = await open({ target: document.querySelector('test')});
13+
const result = await render({ target: document.querySelector('test'), env: 'prepub', height: 518, width: 782 });
1414
console.log(result)
1515
unmount({env: 'prepub'});
1616
} catch {

packages/console-utils/xconsole-service/src/interceptors/fastloginInterceptor/login.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export const LoginContent: React.FC<any> = (props) => {
3737
if (ref.current || document.querySelector('#loginContent')) {
3838
(async () => {
3939
try {
40-
const result = await render({ target: ref.current || document.querySelector('#loginContent'), height: 560, width: 501 });
40+
const result = await render({ target: ref.current || document.querySelector('#loginContent'), height: 518, width: 782 });
4141
if (result.success) {
4242
await refreshToken();
4343
}
@@ -51,10 +51,10 @@ export const LoginContent: React.FC<any> = (props) => {
5151
}, [ref.current]);
5252

5353
return (
54-
<Dialog visible footer={<div/>} onClose={() => {props.onError()}}>
55-
<div style={{height: 630, width: 500, paddingTop: 20, overflow: 'hidden'}}>
54+
<Dialog visible footer={false} onClose={() => {props.onError()}}>
55+
<div style={{height: 578, width: 782, paddingTop: 20, overflow: 'hidden'}}>
5656
<div ref={ref} id="loginContent" ></div>
57-
<div style={{textAlign: 'center', width: 500, paddingTop: 20, fontSize: 13}}>
57+
<div style={{textAlign: 'center', width: 782, fontSize: 13}}>
5858
<span >{messages['login_prefix']}</span>
5959
<a href="#" onClick={() => { window.location.reload()}}>{messages['login_action']}</a>
6060
<span >{messages['login_suffix']}</span>

packages/console-utils/xconsole-service/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
"./src/*",
1616
],
1717
"exclude": [
18-
// "node_modules"
18+
"node_modules"
1919
]
2020
}

0 commit comments

Comments
 (0)