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

Commit 26b48fe

Browse files
committed
fix: add the fast login
1 parent 8cb615f commit 26b48fe

File tree

4 files changed

+33
-23
lines changed

4 files changed

+33
-23
lines changed

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ import axios, { AxiosResponse } from 'axios';
22
import React, { useEffect, useRef } from 'react';
33
import ReactDOM from 'react-dom'
44
import { render } from '@alicloud/console-fastlogin';
5-
import { Button, Dialog } from '@alicloud/console-components'
5+
import { Dialog } from '@alicloud/console-components';
66

7+
import messages from './messages';
78
import searchParamsInterceptor from '../paramsInterceptor/index';
89
import { getSecToken, getUmid, getCollina } from '../../utils/index';
910

@@ -51,12 +52,12 @@ export const LoginContent: React.FC<any> = (props) => {
5152

5253
return (
5354
<Dialog visible footer={<div/>} onClose={() => {props.onError()}}>
54-
<div style={{height: 630, width: 500, paddingTop: 20}}>
55+
<div style={{height: 630, width: 500, paddingTop: 20, overflow: 'hidden'}}>
5556
<div ref={ref} id="loginContent" ></div>
5657
<div style={{textAlign: 'center', width: 500, paddingTop: 20, fontSize: 13}}>
57-
<span >快速登录有问题?直接去</span>
58-
<a href="#" onClick={() => { window.location.reload()}}>登录页</a>
59-
<span >登录</span>
58+
<span >{messages['login_prefix']}</span>
59+
<a href="#" onClick={() => { window.location.reload()}}>{messages['login_action']}</a>
60+
<span >{messages['login_suffix']}</span>
6061
</div>
6162
</div>
6263
</Dialog>

packages/console-utils/xconsole-service/src/interceptors/fastloginInterceptor/message.ts

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { getLocale } from '../../utils/index';
2+
3+
const locale = getLocale() || 'en-US';
4+
/* eslint-disable max-len */
5+
const messages = {
6+
'en-US': {
7+
'login_prefix': 'Having trouble with fast login? Go directly to ',
8+
'login_action': 'the login page',
9+
'login_suffix': ' to log in',
10+
},
11+
12+
// 中文文案
13+
'zh-CN': {
14+
'login_prefix': '快速登录有问题?直接去',
15+
'login_action': '登录页',
16+
'login_suffix': '登录',
17+
},
18+
19+
};
20+
21+
export default (messages as any)[locale] || messages['en-US'];

packages/console-utils/xconsole-service/stories/fast-login.stories.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,19 @@ import { createService } from '../src/index'
1010

1111
import '@alicloud/console-components/dist/xconsole.css'
1212

13+
// @ts-ignore
14+
window.ALIYUN_CONSOLE_CONFIG = {
15+
CHANNEL: "OFFICIAL"
16+
}
17+
1318
window.React = React;
1419
window.ReactDOM = ReactDOM
1520
storiesOf('XConsole FastLogin', module)
1621
.addDecorator(withKnobs)
1722
.add('FastLogin', () => {
1823
React.useEffect(() => {
1924
(async () => {
20-
await createService('consoledemo', 'ConsoleNeedLogin')({ xxxx:1 })
25+
await createService('consoledemo', 'ConsoleNeedLogin', { fastLogin: true})({ xxxx:1 })
2126
})()
2227
})
2328
return <div/>

0 commit comments

Comments
 (0)