Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
diseaseControlManage
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
diseaseControlManage-Develop
diseaseControlManage
Commits
48548f48
Commit
48548f48
authored
Nov 06, 2020
by
huqc
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
194620bd
4df7e435
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
6 deletions
+28
-6
config/index.js
+2
-2
src/api/userlogin.js
+12
-0
src/components/UserLogin.vue
+14
-4
No files found.
config/index.js
View file @
48548f48
...
@@ -43,8 +43,8 @@ module.exports = {
...
@@ -43,8 +43,8 @@ module.exports = {
// Paths
// Paths
assetsRoot
:
path
.
resolve
(
__dirname
,
'../dist'
),
assetsRoot
:
path
.
resolve
(
__dirname
,
'../dist'
),
assetsSubDirectory
:
''
,
assetsSubDirectory
:
''
,
assetsDir
:
'./'
,
assetsDir
:
'./'
,
assetsPublicPath
:
''
,
assetsPublicPath
:
'
./
'
,
configureWebpack
:{
configureWebpack
:{
output
:{
output
:{
filename
:
'./js/[name].js'
,
filename
:
'./js/[name].js'
,
...
...
src/api/userlogin.js
View file @
48548f48
...
@@ -17,6 +17,18 @@ export function login(loginID, loginPas) {
...
@@ -17,6 +17,18 @@ export function login(loginID, loginPas) {
})
})
})
})
}
}
//图形码验证
export
function
getCode
(
yzm
){
var
t
=
(
new
Date
).
getTime
();
//每次点击重新取个随机数
return
request
({
url
:
'http://192.168.3.110:8999/diseaseControlManage/api/login/captcha?t='
+
t
+
'&code='
+
yzm
,
method
:
'post'
,
data
:
{},
async
:
false
,
//同步
})
}
//修改密码
//修改密码
export
function
updatePassword
(
uid
,
pwdold
,
pwdnew
)
{
export
function
updatePassword
(
uid
,
pwdold
,
pwdnew
)
{
...
...
src/components/UserLogin.vue
View file @
48548f48
...
@@ -62,10 +62,19 @@
...
@@ -62,10 +62,19 @@
this
.
$message
.
error
(
'用户密码不可为空'
);
this
.
$message
.
error
(
'用户密码不可为空'
);
return
false
return
false
}
}
if
(
!
this
.
captcha_code
){
this
.
$message
.
error
(
'验证码不可为空'
);
return
false
};
let
_this
=
this
let
_this
=
this
// getCode(this.captcha_code).then(res=>{
// console.log(res)
// })
// 用户登录
// 用户登录
//
login(this.loginID, this.$md5(this.loginPas)).then(res => {
login
(
this
.
loginID
,
this
.
$md5
(
this
.
loginPas
)).
then
(
res
=>
{
login
(
this
.
loginID
,
this
.
loginPas
).
then
(
res
=>
{
//
login(this.loginID,this.loginPas).then( res=>{
console
.
log
(
res
)
console
.
log
(
res
)
if
(
res
.
code
==
1
)
{
if
(
res
.
code
==
1
)
{
sessionStorage
.
setItem
(
'token'
,
res
.
data
.
token
);
sessionStorage
.
setItem
(
'token'
,
res
.
data
.
token
);
...
@@ -107,11 +116,12 @@
...
@@ -107,11 +116,12 @@
console
.
log
(
"登录报错!"
);
console
.
log
(
"登录报错!"
);
})
})
},
},
//更换验证码
//更换验证码
changeCode
()
{
changeCode
()
{
this
.
$refs
.
code
.
setAttribute
(
this
.
$refs
.
code
.
setAttribute
(
"src"
,
'http://
shiro.easyweb.vip/assets
/captcha'
+
'?t='
+
(
new
Date
).
getTime
()
"src"
,
'http://
192.168.3.110:8999/diseaseControlManage/api/login
/captcha'
+
'?t='
+
(
new
Date
).
getTime
()
);
);
}
}
...
@@ -119,7 +129,7 @@
...
@@ -119,7 +129,7 @@
},
},
mounted
()
{
mounted
()
{
this
.
$refs
.
code
.
setAttribute
(
this
.
$refs
.
code
.
setAttribute
(
"src"
,
'http://
shiro.easyweb.vip/assets
/captcha'
"src"
,
'http://
192.168.3.110:8999/diseaseControlManage/api/login
/captcha'
);
);
if
(
sessionStorage
.
getItem
(
'userID'
)
&&
sessionStorage
.
getItem
(
'userPas'
))
{
if
(
sessionStorage
.
getItem
(
'userID'
)
&&
sessionStorage
.
getItem
(
'userPas'
))
{
...
...
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