Browse Source

chore: login compose

master
wangxiang 2 years ago
parent
commit
52374b3dc0
No known key found for this signature in database
GPG Key ID: 1BA7946AB6B232E4
  1. 1
      src/locales/lang/en/sys.ts
  2. 1
      src/locales/lang/zh-CN/sys.ts
  3. 48
      src/views/system/ssoLogin/kics/index.vue

1
src/locales/lang/en/sys.ts

@ -94,6 +94,7 @@ export default { @@ -94,6 +94,7 @@ export default {
// 占位符
accountPlaceholder: 'Please input username',
passwordPlaceholder: 'Please input password',
identityProviderPlaceholder: 'Please select identity provider',
smsPlaceholder: 'Please input sms code',
mobilePlaceholder: 'Please input mobile',
policyPlaceholder: 'Register after checking',

1
src/locales/lang/zh-CN/sys.ts

@ -89,6 +89,7 @@ export default { @@ -89,6 +89,7 @@ export default {
// 占位符
accountPlaceholder: '请输入账号',
passwordPlaceholder: '请输入密码',
identityProviderPlaceholder: '请选择身份提供商',
smsPlaceholder: '请输入验证码',
mobilePlaceholder: '请输入手机号码',
policyPlaceholder: '勾选后才能注册',

48
src/views/system/ssoLogin/kics/index.vue

@ -47,19 +47,41 @@ @@ -47,19 +47,41 @@
/>
</a-form-item>
</div>
<div class="aui-inputClear">
<i class="icon icon-role"/>
<a-form-item>
<ApiSelect
v-model:value="formData.identityProvider"
:api="getDataByDictType"
:params="{
type: 'identityProvider',
tenantId: formData.tenantId
}"
:bordered="false"
labelField="label"
valueField="value"
placeholder="请选择角色"
/>
</a-form-item>
</div>
</div>
</a-form>
</div>
<div class="aui-formButton">
<div style="margin-top: 12px" class="aui-formButton">
<div class="aui-flex">
<a-button
:loading="loginLoading"
class="aui-link-login aui-flex-box"
class="aui-link-login aui-flex-box "
type="primary"
@click="handleLogin"
>{{ t('sys.login.loginButton') }}</a-button>
</div>
</div>
<div class="other-login-ways">
<span><a href="https://kicc.kanglailab.com/">康来智慧冷链平台</a></span>
<a-divider type="vertical"/>
<span><a href="https://kicc.kanglailab.com/">康来报告单平台</a></span>
</div>
</div>
</div>
</div>
@ -84,6 +106,10 @@ @@ -84,6 +106,10 @@
import { useDesign } from '/@/hooks/web/useDesign';
import { useAppInject } from '/@/hooks/web/useAppInject';
import { useRouter } from 'vue-router';
import { ApiSelect } from '/@/components/Form';
import { getDataByDictType } from '/@/api/platform/system/controller/dictdata';
import {LoginStateEnum} from '/@/views/core/login/useLogin';
import {Button, Checkbox} from 'ant-design-vue';
const { currentRoute, replace } = useRouter();
const { params, query } = unref(currentRoute);
@ -97,6 +123,8 @@ @@ -97,6 +123,8 @@
const formData = reactive<Recordable>({
username: '',
password: '',
identityProvider: undefined,
tenantId: '1510456530575347712',
});
const loginRef = ref();
const loginLoading = ref<boolean>(false);
@ -111,11 +139,17 @@ @@ -111,11 +139,17 @@
createMessage.warn(t('sys.login.passwordPlaceholder'));
return;
}
if (!formData.identityProvider) {
createMessage.warn(t('sys.login.identityProviderPlaceholder'));
return;
}
try {
loginLoading.value = true;
await userStore.login({
password: formData.password,
username: formData.username,
identityProvider: formData.identityProvider,
tenantId: formData.tenantId,
goHome: false,
clientId: 'kics',
performPostLoginAction: false
@ -202,6 +236,16 @@ @@ -202,6 +236,16 @@
margin-left: 5px;
}
}
.other-login-ways {
color: rgba(0,0,0,.5);
text-align: center;
margin-top: 20px;
span {
padding: 5px;
}
}
</style>
<style lang="less">

Loading…
Cancel
Save