Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
W
web-site
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张冬
web-site
Commits
a54a7302
Commit
a54a7302
authored
Sep 23, 2020
by
吴冠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登录和短信验证码更改
parent
e3cbd55e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
17 deletions
+62
-17
list.js
common/list.js
+1
-1
seek.vue
pages/login/seek.vue
+1
-4
user.vue
pages/login/user.vue
+60
-12
No files found.
common/list.js
View file @
a54a7302
...
@@ -101,7 +101,7 @@ export function sendSms(params){
...
@@ -101,7 +101,7 @@ export function sendSms(params){
//忘记密码---->手机验证码
//忘记密码---->手机验证码
export
function
getVerifyPhone
(
data
){
export
function
getVerifyPhone
(
data
){
return
request
({
return
request
({
url
:
"/verify-phone"
,
url
:
"/
sms/
verify-phone"
,
method
:
'post'
,
method
:
'post'
,
data
:
data
data
:
data
})
})
...
...
pages/login/seek.vue
View file @
a54a7302
...
@@ -201,10 +201,7 @@
...
@@ -201,10 +201,7 @@
dataform
.
phone
=
this
.
form
.
phone
dataform
.
phone
=
this
.
form
.
phone
dataform
.
verify
=
this
.
form
.
verify
dataform
.
verify
=
this
.
form
.
verify
const
{
data
}
=
getVerifyPhone
(
dataform
)
const
{
data
}
=
getVerifyPhone
(
dataform
)
//后端返回个字段 然后判断是否可以登录
this
.
active
++
/* this.dataMsg = data */
/* if(this.form.phoneCode===this.dataMsg){ */
this
.
active
++
/* } */
/* } */
}
else
{
}
else
{
this
.
$message
.
error
(
'有未填写的选项或者错误选项'
);
this
.
$message
.
error
(
'有未填写的选项或者错误选项'
);
...
...
pages/login/user.vue
View file @
a54a7302
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
</el-input>
</el-input>
</el-form-item>
</el-form-item>
<div
class=
"login-btn"
>
<div
class=
"login-btn"
>
<el-button
type=
"primary"
@
click=
"submitForm()"
style=
"width: 100%;"
>
登录
</el-button>
<el-button
type=
"primary"
@
click=
"submitForm
1
()"
style=
"width: 100%;"
>
登录
</el-button>
</div>
</div>
</el-form>
</el-form>
<!-- 手机验证码验证 -->
<!-- 手机验证码验证 -->
...
@@ -28,10 +28,10 @@
...
@@ -28,10 +28,10 @@
<el-form-item
prop=
"phonecode"
class=
"item"
>
<el-form-item
prop=
"phonecode"
class=
"item"
>
<el-input
v-model=
"phone.phonecode"
placeholder=
"请输入短信验证码"
style=
"width:1.8rem"
maxlength=
"30"
></el-input>
<el-input
v-model=
"phone.phonecode"
placeholder=
"请输入短信验证码"
style=
"width:1.8rem"
maxlength=
"30"
></el-input>
</el-form-item>
</el-form-item>
<div
class=
"phonecode handle"
>
获取短信验证码
</div>
<div
class=
"phonecode handle"
@
click =
"getPhoneCode"
>
获取短信验证码
</div>
</div>
</div>
<div
class=
"login-btn"
>
<div
class=
"login-btn"
>
<el-button
type=
"primary"
@
click=
"submitForm()"
style=
"width: 100%;"
>
登录
</el-button>
<el-button
type=
"primary"
@
click=
"submitForm
2
()"
style=
"width: 100%;"
>
登录
</el-button>
</div>
</div>
</el-form>
</el-form>
<div
class=
"login-font flex-between"
>
<div
class=
"login-font flex-between"
>
...
@@ -46,7 +46,7 @@
...
@@ -46,7 +46,7 @@
<
script
>
<
script
>
import
{
powerLogin
}
from
'~/api/bid/login'
;
import
{
powerLogin
}
from
'~/api/bid/login'
;
import
{
getSecond
}
from
'@/common/list.js'
;
import
{
getSecond
,
sendSms
,
getVerifyPhone
}
from
'@/common/list.js'
;
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
...
@@ -89,19 +89,64 @@
...
@@ -89,19 +89,64 @@
created
()
{
created
()
{
},
},
methods
:
{
methods
:
{
/* async getSecond(){
//发送短信验证码
const {data} = await getSecond()
async
getPhoneCode
(){
console.log(data+'------------------------')
let
message
=
{}
}, */
message
.
phone
=
this
.
phone
.
phone
async
submitForm
(
event
)
{
message
.
type
=
2
const
{
data
}
=
await
sendSms
(
message
)
},
async
submitForm1
()
{
try
{
const
valid
=
await
this
.
$refs
[
'params'
].
validate
()
if
(
valid
)
{
/* const {
msg,
code,
data
} = await powerLogin(this.param) */
//将手机号和手机验证码发送
let
mess
=
{}
mess
.
phone
=
this
.
phone
.
phone
mess
.
verify
=
this
.
phone
.
password
const
{
data
,
code
,
msg
}
=
await
getVerifyPhone
(
mess
)
console
.
log
(
data
,
code
)
if
(
code
==
200
)
{
sessionStorage
.
setItem
(
"token"
,
data
);
this
.
$message
({
message
:
msg
,
type
:
'success'
,
duration
:
1500
});
setTimeout
(()
=>
{
this
.
$router
.
push
(
"/"
)
},
1500
)
}
else
{
this
.
$message
({
message
:
msg
,
type
:
'error'
});
}
}
}
catch
(
err
)
{
console
.
log
(
err
);
}
},
async
submitForm2
()
{
try
{
try
{
const
valid
=
await
this
.
$refs
[
'p
aram
'
].
validate
()
const
valid
=
await
this
.
$refs
[
'p
hone
'
].
validate
()
if
(
valid
)
{
if
(
valid
)
{
const
{
/*
const {
msg,
msg,
code,
code,
data
data
}
=
await
powerLogin
(
this
.
param
)
} = await powerLogin(this.param) */
//将手机号和手机验证码发送
let
mess
=
{}
mess
.
phone
=
this
.
phone
.
phone
mess
.
verify
=
this
.
phone
.
phonecode
const
{
data
,
code
,
msg
}
=
await
getVerifyPhone
(
mess
)
console
.
log
(
data
,
code
)
if
(
code
==
200
)
{
if
(
code
==
200
)
{
sessionStorage
.
setItem
(
"token"
,
data
);
sessionStorage
.
setItem
(
"token"
,
data
);
this
.
$message
({
this
.
$message
({
...
@@ -226,4 +271,7 @@
...
@@ -226,4 +271,7 @@
.el-form
{
.el-form
{
padding
:
0.2rem
padding
:
0.2rem
}
}
/* .login-btn{
cursor: pointer;
} */
</
style
>
</
style
>
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