Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
9
91isoft_vue_manage
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨硕
91isoft_vue_manage
Commits
81f9ddd6
Commit
81f9ddd6
authored
Dec 29, 2020
by
刘洪铨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登录
parent
7a35ed48
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
17 deletions
+17
-17
login.js
src/api/login.js
+1
-1
user.js
src/store/modules/user.js
+2
-2
login.vue
src/views/login/login.vue
+14
-14
No files found.
src/api/login.js
View file @
81f9ddd6
...
...
@@ -11,7 +11,7 @@ export function login(username, password, code, uuid) {
return
request
({
url
:
'/auth/login'
,
method
:
'post'
,
data
:
data
,
params
:
data
,
headers
:
{
'Content-Type'
:
'application/x-www-form-urlencoded'
}
...
...
src/store/modules/user.js
View file @
81f9ddd6
...
...
@@ -42,8 +42,8 @@ const user = {
// const uuid = userInfo.uuid
return
new
Promise
((
resolve
,
reject
)
=>
{
login
(
username
,
password
).
then
(
res
=>
{
setToken
(
res
.
token
)
commit
(
'SET_TOKEN'
,
res
.
token
)
setToken
(
res
.
data
)
commit
(
'SET_TOKEN'
,
res
.
data
)
resolve
()
}).
catch
(
error
=>
{
reject
(
error
)
...
...
src/views/login/login.vue
View file @
81f9ddd6
...
...
@@ -30,9 +30,9 @@
>
<svg-icon
slot=
"prefix"
icon-class=
"validCode"
class=
"el-input__icon input-icon"
/>
</el-input>
<div
class=
"login-code"
>
<
!--
<
div
class=
"login-code"
>
<img
:src=
"codeUrl"
@
click=
"getCode"
>
</div>
</div>
-->
</el-form-item>
<el-form-item
style=
"width:80%;margin-bottom: 20px"
>
<el-button
...
...
@@ -65,7 +65,7 @@
</
template
>
<
script
>
import
{
getCodeImg
}
from
'@/api/login'
//
import { getCodeImg } from '@/api/login'
import
Cookies
from
'js-cookie'
import
{
encrypt
,
decrypt
}
from
'@/utils/jsencrypt'
...
...
@@ -77,8 +77,8 @@ export default {
codeUrl
:
''
,
cookiePassword
:
''
,
loginForm
:
{
username
:
'
admi
n'
,
password
:
'
admin123
'
,
username
:
'
guanliyua
n'
,
password
:
'
123456
'
,
rememberMe
:
false
,
code
:
''
,
uuid
:
''
...
...
@@ -96,7 +96,7 @@ export default {
}
},
created
()
{
this
.
getCode
()
//
this.getCode()
this
.
getCookie
()
},
methods
:
{
...
...
@@ -106,12 +106,12 @@ export default {
query
:
this
.
$route
.
query
})
},
getCode
()
{
/*
getCode() {
getCodeImg().then(res => {
this.codeUrl = 'data:image/gif;base64,' + res.img
this.loginForm.uuid = res.uuid
})
},
},
*/
getCookie
()
{
const
username
=
Cookies
.
get
(
'username'
)
const
password
=
Cookies
.
get
(
'password'
)
...
...
@@ -144,7 +144,7 @@ export default {
})
.
catch
(()
=>
{
this
.
loading
=
false
this
.
getCode
()
//
this.getCode()
})
}
})
...
...
@@ -213,7 +213,7 @@ export default {
width
:
26
.8vw
;
height
:
40px
;
border-radius
:
4px
;
font-size
:
18px
;
font-size
:
18px
;
}
}
.el-input
{
...
...
@@ -255,10 +255,10 @@ export default {
letter-spacing
:
1px
;
}
.buttons-content
{
display
:
flex
;
width
:
80%
;
justify-content
:
space-between
;
padding
:
0
14px
;
display
:
flex
;
width
:
80%
;
justify-content
:
space-between
;
padding
:
0
14px
;
.rem-code
span
{
color
:
$font-dark
;
}
...
...
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