Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
work-order-web
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
张圳龙
work-order-web
Commits
35e824d2
Commit
35e824d2
authored
Aug 17, 2020
by
Mr. Lan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加ldap校验登陆
parent
beea0349
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
6 deletions
+13
-6
user.js
src/api/user.js
+2
-2
user.js
src/store/modules/user.js
+5
-1
index.vue
src/views/login/index.vue
+6
-3
No files found.
src/api/user.js
View file @
35e824d2
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
})
...
...
src/store/modules/user.js
View file @
35e824d2
...
...
@@ -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
)
...
...
src/views/login/index.vue
View file @
35e824d2
...
...
@@ -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
:
[
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment