Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
A
alumni-show-h5
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
alumni-show-h5
Commits
3a85031a
提交
3a85031a
authored
6月 22, 2020
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update login
上级
3eb4e76c
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
136 行增加
和
6 行删除
+136
-6
index.js
src/router/index.js
+1
-1
AccountLogin.vue
src/views/login/AccountLogin.vue
+47
-0
CodeLogin.vue
src/views/login/CodeLogin.vue
+84
-0
Login.vue
src/views/login/Login.vue
+4
-5
Password.vue
src/views/login/Password.vue
+0
-0
没有找到文件。
src/router/index.js
浏览文件 @
3a85031a
...
...
@@ -8,7 +8,7 @@ const routes = [
{
name
:
'login'
,
path
:
'/login'
,
component
:
()
=>
import
(
'@/views/Login.vue'
)
component
:
()
=>
import
(
'@/views/
login/
Login.vue'
)
},
// 首页
{
...
...
src/views/login/AccountLogin.vue
0 → 100644
浏览文件 @
3a85031a
<
template
>
<div
class=
"login-form account-login"
>
<div
class=
"login-form__item"
>
<input
type=
"text"
class=
"login-input"
placeholder=
"手机/邮箱/用户名"
v-model=
"ruleForm.account"
/>
</div>
<div
class=
"login-form__item"
>
<input
type=
"password"
class=
"login-input"
placeholder=
"密码"
v-model=
"ruleForm.password"
@
keyup
.
enter=
"onSubmit"
/>
</div>
</div>
</
template
>
<
script
>
export
default
{
name
:
'AccountLogin'
,
data
()
{
return
{
ruleForm
:
{
account
:
''
,
password
:
''
}
}
},
methods
:
{
submit
()
{
if
(
!
this
.
ruleForm
.
account
)
{
this
.
$notify
(
'请输入手机/邮箱/用户名'
)
return
false
}
else
if
(
!
this
.
ruleForm
.
password
)
{
this
.
$notify
(
'请输入密码'
)
return
false
}
return
true
}
}
}
</
script
>
src/views/login/CodeLogin.vue
0 → 100644
浏览文件 @
3a85031a
<
template
>
<div
class=
"login-form code-login"
>
<div
class=
"login-form__item"
>
<input
type=
"text"
class=
"login-input"
placeholder=
"手机号"
v-model=
"ruleForm.account"
/>
</div>
<div
class=
"login-form__item"
>
<input
type=
"password"
class=
"login-input"
placeholder=
"验证码"
v-model=
"ruleForm.password"
@
keyup
.
enter=
"onSubmit"
/>
<countdown-button
@
click
.
native=
"onSendCode"
ref=
"countdown"
></countdown-button>
</div>
</div>
</
template
>
<
script
>
import
*
as
api
from
'@/api/account'
import
CountdownButton
from
'@/components/CountdownButton'
export
default
{
name
:
'CodeLogin'
,
components
:
{
CountdownButton
},
data
()
{
return
{
ruleForm
:
{
account
:
''
,
password
:
''
}
}
},
methods
:
{
submit
()
{
if
(
!
this
.
ruleForm
.
account
)
{
this
.
$notify
(
'请输入手机/邮箱/用户名'
)
return
false
}
else
if
(
!
this
.
ruleForm
.
password
)
{
this
.
$notify
(
'请输入密码'
)
return
false
}
return
true
},
// 发送验证码
onSendCode
()
{
this
.
$refs
.
form
.
validate
(
'account'
).
then
(
response
=>
{
if
(
!
response
)
{
// 开始倒计时
this
.
$refs
[
'countdown'
].
start
()
this
.
sendCodeRequest
()
}
})
},
// 验证码
sendCodeRequest
()
{
api
.
sendResetPasswordCode
({
account
:
this
.
ruleForm
.
account
})
.
then
(
response
=>
{
if
(
response
.
code
===
0
)
{
this
.
$notify
({
type
:
'success'
,
message
:
'验证码发送成功'
})
}
else
{
// 停止计时
this
.
$refs
[
'countdown'
].
stop
()
this
.
$notify
(
response
.
msg
)
}
})
.
catch
(
error
=>
{
// 停止计时
this
.
$refs
[
'countdown'
].
stop
()
error
.
response
&&
this
.
$notify
(
error
.
response
.
data
.
message
)
})
}
}
}
</
script
>
src/views/Login.vue
→
src/views/
login/
Login.vue
浏览文件 @
3a85031a
...
...
@@ -49,6 +49,8 @@
import
Cookies
from
'js-cookie'
import
*
as
api
from
'@/api/account'
// import AccountLogin from './AccountLogin.vue'
// import CodeLogin from './CodeLogin.vue'
import
Password
from
'./Password.vue'
export
default
{
...
...
@@ -57,6 +59,7 @@ export default {
const
UA
=
navigator
.
userAgent
.
toLowerCase
()
return
{
ruleForm
:
{
type
:
1
,
account
:
''
,
password
:
''
,
RememberMe
:
false
...
...
@@ -87,7 +90,6 @@ export default {
// 登录
loginRequest
()
{
let
data
=
Object
.
assign
({},
this
.
ruleForm
,
{
type
:
1
,
service
:
'https://h5.ezijing.com'
})
api
...
...
@@ -101,10 +103,7 @@ export default {
},
// 绑定微信并登录
bindWechat
()
{
let
data
=
Object
.
assign
({},
this
.
ruleForm
,
{
unionid
:
this
.
unionid
,
type
:
1
})
let
data
=
Object
.
assign
({},
this
.
ruleForm
,
{
unionid
:
this
.
unionid
})
api
.
bindWechat
(
data
)
.
then
(
response
=>
{
...
...
src/views/Password.vue
→
src/views/
login/
Password.vue
浏览文件 @
3a85031a
File moved
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论