🎉 增加验证码配置开关
This commit is contained in:
parent
4a58def4fb
commit
3f007b94d2
|
|
@ -3,6 +3,7 @@ module.exports = {
|
|||
clientId: 'sword', // 客户端id
|
||||
clientSecret: 'sword_secret', // 客户端密钥
|
||||
tenantMode: true, // 开启租户模式
|
||||
captchaMode: true, // 开启验证码模式
|
||||
navTheme: 'dark', // theme for nav menu
|
||||
primaryColor: '#1890FF', // primary color of ant design
|
||||
layout: 'sidemenu', // nav menu position: sidemenu or topmenu
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { formatMessage, FormattedMessage } from 'umi/locale';
|
|||
import { Checkbox, Alert } from 'antd';
|
||||
import Login from '../../components/Login';
|
||||
import styles from './Login.less';
|
||||
import { tenantMode } from '../../defaultSettings';
|
||||
import { tenantMode, captchaMode } from '../../defaultSettings';
|
||||
|
||||
const { Tab, TenantId, UserName, Password, Captcha, Submit } = Login;
|
||||
|
||||
|
|
@ -117,7 +117,7 @@ class LoginPage extends Component {
|
|||
]}
|
||||
onPressEnter={() => this.loginForm.validateFields(this.handleSubmit)}
|
||||
/>
|
||||
<Captcha name="code" mode="image" />
|
||||
{captchaMode ? <Captcha name="code" mode="image" /> : null}
|
||||
</Tab>
|
||||
<div>
|
||||
<Checkbox checked={autoLogin} onChange={this.changeAutoLogin}>
|
||||
|
|
|
|||
|
|
@ -2,12 +2,13 @@ import { stringify } from 'qs';
|
|||
import request from '../utils/request';
|
||||
import func from '../utils/Func';
|
||||
import { getCaptchaKey } from '../utils/authority';
|
||||
import { captchaMode } from '../defaultSettings';
|
||||
|
||||
// =====================用户===========================
|
||||
|
||||
export async function accountLogin(params) {
|
||||
const values = params;
|
||||
values.grantType = 'captcha';
|
||||
values.grantType = captchaMode ? 'captcha' : 'password';
|
||||
values.scope = 'all';
|
||||
return request('/api/blade-auth/token', {
|
||||
headers: {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user