Commit 35e824d2 by Mr. Lan

添加ldap校验登陆

parent beea0349
import request from '@/utils/request'
export function login(data) {
export function login(data, loginType) {
return request({
url: '/login',
url: `/login?login_type=${loginType}`,
method: 'post',
data
})
......
......@@ -40,8 +40,12 @@ const mutations = {
const actions = {
// user login
login({ commit }, userInfo) {
var loginType = 0
if (userInfo.loginType === true) {
loginType = 1
}
return new Promise((resolve, reject) => {
login(userInfo).then(response => {
login(userInfo, loginType).then(response => {
const { token } = response
commit('SET_TOKEN', token)
setToken(token)
......
......@@ -68,7 +68,7 @@
</span>
</el-form-item>
</el-tooltip>
<el-form-item prop="code" style="width: 66%;float: left;">
<el-form-item prop="code" style="width: 66%;float: left; margin-bottom: 13px">
<span class="svg-container">
<svg-icon icon-class="validCode" />
</span>
......@@ -88,7 +88,9 @@
<div class="login-code" style="cursor:pointer; width: 30%;height: 48px;float: right;background-color: #f0f1f5;">
<img style="height: 48px;width: 100%;border: 1px solid rgba(0,0,0, 0.1);border-radius:5px;" :src="codeUrl" @click="getCode">
</div>
<div prop="code" style="width: 100%;float: left;margin-bottom: 13px">
<el-checkbox v-model="loginForm.loginType">LDAP登陆</el-checkbox>
</div>
<el-button :loading="loading" type="primary" style="width:100%;padding:12px 20px;margin-bottom:30px;" @click.native.prevent="handleLogin">
<span v-if="!loading">登 录</span>
<span v-else>登 录 中...</span>
......@@ -127,7 +129,8 @@ export default {
password: '123456',
rememberMe: false,
code: '',
uuid: ''
uuid: '',
loginType: true
},
loginRules: {
username: [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment