Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
campSite
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨梦雪
campSite
Commits
1c0f3c03
Commit
1c0f3c03
authored
Sep 08, 2023
by
wuwangwolihui
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/yingdi2.0' into yingdi2.0
parents
9eda2c8c
6e42c0ed
Changes
7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
1186 additions
and
958 deletions
+1186
-958
src/request/base/register.js
src/request/base/register.js
+55
-0
src/router/base/login.js
src/router/base/login.js
+1
-1
src/router/index.js
src/router/index.js
+3
-1
src/views/base/login/Index.vue
src/views/base/login/Index.vue
+40
-45
src/views/base/login/Login.vue
src/views/base/login/Login.vue
+457
-266
src/views/base/login/Register.vue
src/views/base/login/Register.vue
+326
-335
src/views/base/login/Reset.vue
src/views/base/login/Reset.vue
+304
-310
No files found.
src/request/base/register.js
0 → 100644
View file @
1c0f3c03
/* eslint-disable */
import
{
request
}
from
'
./network
'
// 通过邮箱验证码注册
export
function
registerEmailCode
(
data
)
{
return
request
({
method
:
'
post
'
,
url
:
'
web/code/registerEmailCode
'
,
params
:
data
})
}
// 通过邮箱验证码找回密码(忘记密码)
export
function
passwordEmailCode
(
data
)
{
return
request
({
method
:
'
post
'
,
url
:
'
web/code/passwordEmailCode
'
,
params
:
data
})
}
// 发送注册时候验证码
export
function
registerCode
(
data
)
{
return
request
({
method
:
'
post
'
,
url
:
'
/web/code/registerCode
'
,
params
:
data
})
}
export
function
passwordCode
(
data
)
{
return
request
({
method
:
'
post
'
,
url
:
'
/web/code/passwordCode
'
,
params
:
data
})
}
// 填写注册信息
export
function
setAccountInfo
(
data
)
{
return
request
({
method
:
'
post
'
,
url
:
'
/web/register/setAccountInfo
'
,
data
})
}
// 获取注册信息
export
function
getAccountInfo
(
data
)
{
return
request
({
method
:
'
post
'
,
url
:
'
/web/register/getAccountInfo
'
,
data
})
}
src/router/base/login.js
View file @
1c0f3c03
...
@@ -15,7 +15,7 @@ export default [{
...
@@ -15,7 +15,7 @@ export default [{
}
}
},
},
{
{
path
:
'
/
r
eset
'
,
path
:
'
/
baseR
eset
'
,
name
:
'
base-reset
'
,
name
:
'
base-reset
'
,
component
:
()
=>
import
(
/* webpackChunkName: "reset" */
'
v/base/login/Reset.vue
'
),
component
:
()
=>
import
(
/* webpackChunkName: "reset" */
'
v/base/login/Reset.vue
'
),
meta
:
{
meta
:
{
...
...
src/router/index.js
View file @
1c0f3c03
...
@@ -204,7 +204,9 @@ router.beforeEach((to, from, next) => {
...
@@ -204,7 +204,9 @@ router.beforeEach((to, from, next) => {
toLogin
=
"
/login
"
,
toLogin
=
"
/login
"
,
toBaseLogin
=
"
/baseLogin
"
,
toBaseLogin
=
"
/baseLogin
"
,
toRegister
=
"
/register
"
,
toRegister
=
"
/register
"
,
toBaseRegister
=
"
/baseRegister
"
,
toReset
=
"
/reset
"
,
toReset
=
"
/reset
"
,
toBaseReset
=
"
/baseReset
"
,
toHome
=
"
/home
"
,
toHome
=
"
/home
"
,
toActive
=
"
/active
"
;
toActive
=
"
/active
"
;
let
toMyInfo
;
let
toMyInfo
;
...
@@ -225,7 +227,7 @@ router.beforeEach((to, from, next) => {
...
@@ -225,7 +227,7 @@ router.beforeEach((to, from, next) => {
// }
// }
// });
// });
return
next
();
return
next
();
}
else
if
(
to
.
path
==
toBaseLogin
||
to
.
path
==
toMyInfo
||
to
.
path
==
toHome
||
to
.
path
==
toActive
||
to
.
path
.
indexOf
(
toActive
)
!=
-
1
)
{
}
else
if
(
to
.
path
==
toBaseLogin
||
to
.
path
==
toBaseRegister
||
to
.
path
==
toBaseReset
||
to
.
path
==
toMyInfo
||
to
.
path
==
toHome
||
to
.
path
==
toActive
||
to
.
path
.
indexOf
(
toActive
)
!=
-
1
)
{
return
next
();
return
next
();
}
else
if
(
to
.
name
==
"
recruit
"
)
{
}
else
if
(
to
.
name
==
"
recruit
"
)
{
code
=
to
.
params
.
code
;
code
=
to
.
params
.
code
;
...
...
src/views/base/login/Index.vue
View file @
1c0f3c03
<
template
>
<
template
>
<div
class=
"login-index"
>
<div
class=
"login-index"
>
<Header></Header>
<div
class=
"big-right"
>
<div
class=
"big-right"
>
<div
class=
"info-box"
>
<div
class=
"info-box"
>
<router-view
/>
<router-view/>
</div>
</div>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
/* eslint-disable */
/* eslint-disable */
import
Cookie
from
"
js-cookie
"
import
Header
from
"
@/components/base/Header.vue
"
;
export
default
{
export
default
{
name
:
"
loginBase
"
,
name
:
"
loginBase
"
,
data
()
{
data
()
{
return
{
return
{};
};
},
},
created
()
{
components
:
{
Header
,
this
.
$emit
(
"
getStatus
"
,
false
);
},
},
methods
:
{
created
()
{
toHome
()
{
let
code
=
this
.
$store
.
state
.
indexIdentity
;
this
.
$router
.
push
(
"
/
"
+
code
);
}
},
},
};
methods
:
{},
};
</
script
>
</
script
>
<
style
scoped
lang=
"scss"
>
<
style
lang=
"scss"
scoped
>
.login-index
{
@media
(
min-width
:
1024px
)
{
.login-index
.big-right
.info-box
{
width
:
32%
!
important
;
top
:
60%
!
important
;
}
}
.login-index
{
position
:
relative
;
position
:
relative
;
min-width
:
1104px
;
min-width
:
1104px
;
background
:
#f8f8f8
;
background
:
#f8f8f8
;
display
:
flex
;
flex-flow
:
row
;
min-height
:
100%
;
.big-img
{
width
:
(
500
/
1920
*
100%
);
min-width
:
350px
;
min-height
:
100%
;
min-height
:
100%
;
img
{
width
:
100%
;
width
:
100%
;
min-height
:
100%
;
}
}
.big-right
{
.big-right
{
flex
:
1
;
height
:
calc
(
100%
-
80px
)
;
position
:
relative
;
.info-box
{
.info-box
{
width
:
520px
;
width
:
520px
;
height
:
auto
;
height
:
auto
;
...
@@ -59,5 +54,5 @@ export default {
...
@@ -59,5 +54,5 @@ export default {
transform
:
translate
(
-50%
,
-50%
);
transform
:
translate
(
-50%
,
-50%
);
}
}
}
}
}
}
</
style
>
</
style
>
src/views/base/login/Login.vue
View file @
1c0f3c03
This diff is collapsed.
Click to expand it.
src/views/base/login/Register.vue
View file @
1c0f3c03
...
@@ -16,26 +16,26 @@
...
@@ -16,26 +16,26 @@
v-model=
"registerForm.phone"
v-model=
"registerForm.phone"
placeholder=
"请输入手机号"
placeholder=
"请输入手机号"
maxlength=
"11"
maxlength=
"11"
autocomplete=
"off"
></el-input>
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
prop=
"email"
>
<
!--
<
el-form-item
prop=
"email"
>
<img
class=
"img_l"
src=
"@/assets/img/reset/username.png"
alt=
""
/>
<img
class=
"img_l"
src=
"@/assets/img/reset/username.png"
alt=
""
/>
<el-input
<el-input
v-model=
"registerForm.email"
v-model=
"registerForm.email"
placeholder=
"请输入邮箱"
placeholder=
"请输入邮箱"
autocomplete=
"off"
></el-input>
></el-input>
</el-form-item>
</el-form-item>
-->
<
!--
<
el-form-item
prop=
"code"
>
<el-form-item
prop=
"code"
>
<img
class=
"img_l"
src=
"@/assets/img/reset/code.png"
alt=
""
/>
<img
class=
"img_l"
src=
"@/assets/img/reset/code.png"
alt=
""
/>
<el-input
<el-input
v-model=
"registerForm.code"
v-model=
"registerForm.code"
placeholder=
"请输入短信验证码"
placeholder=
"请输入短信验证码"
maxlength=
"20"
maxlength=
"20"
autocomplete=
"off"
></el-input>
-->
></el-input>
<!-- 短信验证码 -->
<!-- 短信验证码 -->
<!--
<div
class=
"phoneCode"
>
<!--
<div
class=
"phoneCode"
>
<span
class=
"code"
v-show=
"show"
@
click=
"getCode"
<span
class=
"code"
v-show=
"show"
@
click=
"getCode"
...
@@ -44,18 +44,18 @@
...
@@ -44,18 +44,18 @@
<span
v-show=
"!show"
class=
"count"
>
{{
count
}}
s
</span>
<span
v-show=
"!show"
class=
"count"
>
{{
count
}}
s
</span>
</div>
</div>
</el-form-item>
-->
</el-form-item>
-->
<el-form-item
prop=
"code"
>
<!--
<el-form-item
prop=
"code"
>
<img
class=
"img_l"
src=
"@/assets/img/reset/code.png"
alt=
""
/>
<img
class=
"img_l"
src=
"@/assets/img/reset/code.png"
alt=
""
/>
<el-input
<el-input
v-model=
"registerForm.code"
v-model=
"registerForm.code"
placeholder=
"请输入邮箱注册验证码"
placeholder=
"请输入邮箱注册验证码"
maxlength=
"6"
maxlength=
"6"
autocomplete=
"off"
></el-input
>
></el-input>
--
>
<!-- 短信验证码 -->
<!-- 短信验证码 -->
<div
class=
"phoneCode"
>
<div
class=
"phoneCode"
>
<span
class=
"code"
v-show=
"showCode"
@
click=
"getCode"
<span
class=
"code"
v-show=
"showCode"
@
click=
"getCode"
>
获取邮箱
验证码
</span
>
获取
验证码
</span
>
>
<span
v-show=
"!showCode"
class=
"count"
>
{{
count
}}
s
</span>
<span
v-show=
"!showCode"
class=
"count"
>
{{
count
}}
s
</span>
</div>
</div>
...
@@ -89,7 +89,7 @@
...
@@ -89,7 +89,7 @@
v-model=
"registerForm.rq_password"
v-model=
"registerForm.rq_password"
placeholder=
"请再次输入登录密码"
placeholder=
"请再次输入登录密码"
maxlength=
"20"
maxlength=
"20"
autocomplete=
"off"
></el-input>
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
style=
"margin: 40px 0 0 0"
></el-form-item>
<el-form-item
style=
"margin: 40px 0 0 0"
></el-form-item>
...
@@ -106,20 +106,18 @@
...
@@ -106,20 +106,18 @@
</
template
>
</
template
>
<
script
>
<
script
>
/* eslint-disable */
/* eslint-disable */
// 请求接口
import
{
import
{
registerCode
,
registerCode
,
setAccountInfo
,
setAccountInfo
,
registerEmailCode
,
registerEmailCode
,
}
from
"
r/index
/register
"
;
}
from
"
r/base
/register
"
;
import
{
mobileCheck
,
checkStrong
}
from
"
@/common/utils.js
"
;
import
{
mobileCheck
,
checkStrong
}
from
"
@/common/utils.js
"
;
import
validator
from
"
common/validator
"
;
import
validator
from
"
common/validator
"
;
import
{
intervalTime
}
from
"
store/time
"
;
import
{
intervalTime
}
from
"
store/time
"
;
export
default
{
export
default
{
name
:
"
index
-register
"
,
name
:
"
base
-register
"
,
data
()
{
data
()
{
const
pwdCheck
=
async
(
rule
,
value
,
callback
)
=>
{
const
pwdCheck
=
async
(
rule
,
value
,
callback
)
=>
{
if
(
value
!==
this
.
registerForm
.
password
)
{
if
(
value
!==
this
.
registerForm
.
password
)
{
...
@@ -139,7 +137,7 @@ export default {
...
@@ -139,7 +137,7 @@ export default {
isShowPwd
:
true
,
// 控制密码显示隐藏
isShowPwd
:
true
,
// 控制密码显示隐藏
registerForm
:
{
registerForm
:
{
phone
:
""
,
phone
:
""
,
email
:
""
,
//
email: "",
code
:
""
,
code
:
""
,
password
:
""
,
password
:
""
,
rq_password
:
""
,
rq_password
:
""
,
...
@@ -161,13 +159,13 @@ export default {
...
@@ -161,13 +159,13 @@ export default {
},
},
],
],
// 对邮箱验证
// 对邮箱验证
email
:
[
//
email: [
{
required
:
true
,
message
:
"
请输入邮箱
"
,
trigger
:
"
blur
"
},
//
{ required: true, message: "请输入邮箱", trigger: "blur" },
{
//
{
validator
:
validator
.
validateEmail
,
//
validator: validator.validateEmail,
trigger
:
"
blur
"
,
//
trigger: "blur",
},
//
},
],
//
],
// 对验证码进行校验
// 对验证码进行校验
code
:
[
code
:
[
{
required
:
true
,
message
:
"
请输入验证码
"
,
trigger
:
"
blur
"
},
{
required
:
true
,
message
:
"
请输入验证码
"
,
trigger
:
"
blur
"
},
...
@@ -218,19 +216,17 @@ export default {
...
@@ -218,19 +216,17 @@ export default {
};
};
},
},
created
()
{
created
()
{
const
code
=
this
.
$store
.
state
.
indexIdentity
;
const
endTime
=
window
.
localStorage
.
getItem
(
"
register_code_time
"
);
const
endTime
=
window
.
localStorage
.
getItem
(
"
register_code_time
"
+
code
);
if
(
endTime
&&
Number
(
endTime
)
>
new
Date
().
getTime
())
{
if
(
endTime
&&
Number
(
endTime
)
>
new
Date
().
getTime
())
{
this
.
resetForm
.
phone
=
phone
;
this
.
resetForm
.
phone
=
phone
;
this
.
intervalHandle
(
new
Date
(),
Number
(
endTime
));
this
.
intervalHandle
(
new
Date
(),
Number
(
endTime
));
}
}
this
.
commonApi
(
30
)
},
},
methods
:
{
methods
:
{
// 去注册
// 去注册
toLogin
()
{
toLogin
()
{
let
code
=
this
.
$store
.
state
.
indexIdentity
;
this
.
$router
.
push
(
"
/baseLogin
"
);
this
.
$router
.
push
(
"
/login?code=
"
+
code
);
},
},
// 改变密码显示状态
// 改变密码显示状态
changePwdStatus
()
{
changePwdStatus
()
{
...
@@ -257,16 +253,15 @@ export default {
...
@@ -257,16 +253,15 @@ export default {
},
},
// 获取手机验证短信
// 获取手机验证短信
getCode
()
{
getCode
()
{
if
(
!
this
.
registerForm
.
email
)
{
if
(
!
this
.
registerForm
.
phone
)
{
return
this
.
$message
.
error
(
"
请输入邮箱
"
);
return
this
.
$message
.
error
(
"
请输入邮箱
"
);
}
}
// if (!this.codeTime) {
// if (!this.codeTime) {
// return this.$message.error("您已经获取验证码,请去邮箱中进行查看");
// return this.$message.error("您已经获取验证码,请去邮箱中进行查看");
// }
// }
// 接口获得验证码
// 接口获得验证码
registerEmailCode
({
registerCode
({
phone
:
this
.
registerForm
.
phone
,
email
:
this
.
registerForm
.
email
,
}).
then
((
res
)
=>
{
}).
then
((
res
)
=>
{
console
.
log
(
res
,
"
passwordCode
"
);
console
.
log
(
res
,
"
passwordCode
"
);
if
(
res
.
data
.
code
!=
200
)
{
if
(
res
.
data
.
code
!=
200
)
{
...
@@ -275,9 +270,8 @@ export default {
...
@@ -275,9 +270,8 @@ export default {
this
.
$message
.
success
(
res
.
data
.
message
);
this
.
$message
.
success
(
res
.
data
.
message
);
this
.
codeTime
=
res
.
data
.
data
.
now
*
1000
;
this
.
codeTime
=
res
.
data
.
data
.
now
*
1000
;
// console.log(this.codeTime)
// console.log(this.codeTime)
let
code
=
this
.
$store
.
state
.
indexIdentity
;
window
.
localStorage
.
setItem
(
window
.
localStorage
.
setItem
(
"
register_code_time
"
+
code
,
"
register_code_time
"
,
res
.
data
.
data
.
now
*
1000
res
.
data
.
data
.
now
*
1000
);
);
this
.
intervalHandle
(
new
Date
(),
res
.
data
.
data
.
now
*
1000
);
this
.
intervalHandle
(
new
Date
(),
res
.
data
.
data
.
now
*
1000
);
...
@@ -290,7 +284,7 @@ export default {
...
@@ -290,7 +284,7 @@ export default {
if
(
!
valid
)
return
;
if
(
!
valid
)
return
;
setAccountInfo
({
setAccountInfo
({
phone
:
this
.
registerForm
.
phone
,
phone
:
this
.
registerForm
.
phone
,
email
:
this
.
registerForm
.
email
,
//
email: this.registerForm.email,
code
:
this
.
registerForm
.
code
,
code
:
this
.
registerForm
.
code
,
password
:
this
.
registerForm
.
password
,
password
:
this
.
registerForm
.
password
,
rq_password
:
this
.
registerForm
.
rq_password
,
rq_password
:
this
.
registerForm
.
rq_password
,
...
@@ -300,32 +294,29 @@ export default {
...
@@ -300,32 +294,29 @@ export default {
return
this
.
$message
.
error
(
res
.
data
.
message
);
return
this
.
$message
.
error
(
res
.
data
.
message
);
}
}
// this.$message.success(res.data.message);
// this.$message.success(res.data.message);
let
code
=
this
.
$store
.
state
.
indexIdentity
;
// token存储
// token存储
window
.
localStorage
.
setItem
(
"
index-token
"
+
code
,
res
.
data
.
token
);
window
.
localStorage
.
setItem
(
"
index-token
"
,
res
.
data
.
token
);
window
.
localStorage
.
setItem
(
"
phone
"
+
code
,
this
.
registerForm
.
phone
);
window
.
localStorage
.
setItem
(
"
phone
"
,
this
.
registerForm
.
phone
);
window
.
localStorage
.
setItem
(
"
email
"
+
code
,
this
.
registerForm
.
email
);
//邮箱
// window.localStorage.setItem("email" + code, this.registerForm.email);
// 报名信息
// 报名信息
window
.
localStorage
.
setItem
(
"
camp_name
"
+
code
,
res
.
data
.
cam
.
name
);
window
.
localStorage
.
setItem
(
"
camp_name
"
,
res
.
data
.
cam
.
name
);
//获取主题色
//获取主题色
window
.
localStorage
.
setItem
(
window
.
localStorage
.
setItem
(
"
system_color
"
+
code
,
"
system_color
"
,
res
.
data
.
cam
.
system_color
res
.
data
.
cam
.
system_color
);
);
// 跳转到报名
// 跳转到报名
this
.
$router
.
replace
(
"
/signUpList
"
);
this
.
$router
.
push
(
"
/signUp/examInfo?code=
"
+
code
);
});
});
});
});
},
},
},
},
};
};
</
script
>
</
script
>
<
style
scoped
lang=
"scss"
>
<
style
scoped
lang=
"scss"
>
// 注册输入
// 注册输入
.container
{
.container
{
background
:
#ffffff
;
background
:
#ffffff
;
box-shadow
:
0px
1px
18px
0px
rgba
(
0
,
0
,
0
,
0
.06
);
box-shadow
:
0px
1px
18px
0px
rgba
(
0
,
0
,
0
,
0
.06
);
border-radius
:
8px
;
border-radius
:
8px
;
...
@@ -334,8 +325,8 @@ export default {
...
@@ -334,8 +325,8 @@ export default {
overflow
:
hidden
;
overflow
:
hidden
;
.title
{
.title
{
margin
:
19px
0
6px
0
;
//
margin: 19px 0 6px 0;
width
:
132px
;
//
width: 132px;
height
:
20px
;
height
:
20px
;
font-size
:
22px
;
font-size
:
22px
;
font-weight
:
500
;
font-weight
:
500
;
...
@@ -343,12 +334,12 @@ export default {
...
@@ -343,12 +334,12 @@ export default {
line-height
:
20px
;
line-height
:
20px
;
}
}
.line
{
//
.line {
width
:
103px
;
//
width: 103px;
height
:
3px
;
//
height: 3px;
background
:
var
(
--
color
);
//
background: var(--color);
border-radius
:
2px
;
//
border-radius: 2px;
}
//
}
::v-deep
.el-form
{
::v-deep
.el-form
{
margin-top
:
60px
;
margin-top
:
60px
;
...
@@ -449,23 +440,23 @@ export default {
...
@@ -449,23 +440,23 @@ export default {
}
}
}
}
}
}
}
}
@media
screen
and
(
max-width
:
1601px
)
{
@media
screen
and
(
max-width
:
1601px
)
{
.container
{
.container
{
right
:
18%
;
right
:
18%
;
}
}
}
}
@media
screen
and
(
max-width
:
1501px
)
{
@media
screen
and
(
max-width
:
1501px
)
{
.container
{
.container
{
right
:
16%
;
right
:
16%
;
}
}
}
}
@media
screen
and
(
max-width
:
1401px
)
{
@media
screen
and
(
max-width
:
1401px
)
{
.container
{
.container
{
right
:
14%
;
right
:
14%
;
}
}
}
}
</
style
>
</
style
>
src/views/base/login/Reset.vue
View file @
1c0f3c03
...
@@ -16,25 +16,23 @@
...
@@ -16,25 +16,23 @@
v-model=
"resetForm.phone"
v-model=
"resetForm.phone"
placeholder=
"请输入手机号"
placeholder=
"请输入手机号"
maxlength=
"11"
maxlength=
"11"
autocomplete=
"off"
></el-input>
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
prop=
"email"
>
<
!--
<
el-form-item
prop=
"email"
>
<img
class=
"img_l"
src=
"@/assets/img/reset/username.png"
alt=
""
/>
<img
class=
"img_l"
src=
"@/assets/img/reset/username.png"
alt=
""
/>
<el-input
<el-input
v-model=
"resetForm.email"
v-model=
"resetForm.email"
placeholder=
"请输入邮箱"
placeholder=
"请输入邮箱"
autocomplete=
"off"
></el-input>
></el-input>
</el-form-item>
</el-form-item>
-->
<
!--
<
el-form-item
prop=
"code"
>
<el-form-item
prop=
"code"
>
<img
class=
"img_l"
src=
"@/assets/img/reset/code.png"
alt=
""
/>
<img
class=
"img_l"
src=
"@/assets/img/reset/code.png"
alt=
""
/>
<el-input
<el-input
v-model=
"resetForm.code"
v-model=
"resetForm.code"
placeholder=
"请输入短信验证码"
placeholder=
"请输入短信验证码"
maxlength=
"20"
maxlength=
"20"
autocomplete=
"off"
></el-input>
></el-input>
-->
<!-- 短信验证码 -->
<!-- 短信验证码 -->
<!--
<div
class=
"phoneCode"
>
<!--
<div
class=
"phoneCode"
>
<span
class=
"code"
v-show=
"showCode"
@
click=
"getCode"
<span
class=
"code"
v-show=
"showCode"
@
click=
"getCode"
...
@@ -43,18 +41,18 @@
...
@@ -43,18 +41,18 @@
<span
v-show=
"!showCode"
class=
"count"
>
{{
count
}}
s
</span>
<span
v-show=
"!showCode"
class=
"count"
>
{{
count
}}
s
</span>
</div>
</div>
</el-form-item>
-->
</el-form-item>
-->
<el-form-item
prop=
"code"
>
<!--
<el-form-item
prop=
"code"
>
<img
class=
"img_l"
src=
"@/assets/img/reset/code.png"
alt=
""
/>
<img
class=
"img_l"
src=
"@/assets/img/reset/code.png"
alt=
""
/>
<el-input
<el-input
v-model=
"resetForm.code"
v-model=
"resetForm.code"
placeholder=
"请输入邮箱验证码"
placeholder=
"请输入邮箱验证码"
maxlength=
"6"
maxlength=
"6"
autocomplete=
"off"
></el-input>
></el-input>
-->
<!-- 短信验证码 -->
<!-- 短信验证码 -->
<div
class=
"phoneCode"
>
<div
class=
"phoneCode"
>
<span
class=
"code"
v-show=
"showCode"
@
click=
"getCode"
<span
class=
"code"
v-show=
"showCode"
@
click=
"getCode"
>
获取邮箱
验证码
</span
>
获取
验证码
</span
>
>
<span
v-show=
"!showCode"
class=
"count"
>
{{
count
}}
s
</span>
<span
v-show=
"!showCode"
class=
"count"
>
{{
count
}}
s
</span>
</div>
</div>
...
@@ -88,7 +86,6 @@
...
@@ -88,7 +86,6 @@
v-model=
"resetForm.rq_password"
v-model=
"resetForm.rq_password"
placeholder=
"请再次输入新的登录密码"
placeholder=
"请再次输入新的登录密码"
maxlength=
"20"
maxlength=
"20"
autocomplete=
"off"
></el-input>
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
style=
"margin: 40px 0 0 0"
></el-form-item>
<el-form-item
style=
"margin: 40px 0 0 0"
></el-form-item>
...
@@ -105,16 +102,16 @@
...
@@ -105,16 +102,16 @@
</
template
>
</
template
>
<
script
>
<
script
>
/* eslint-disable */
/* eslint-disable */
// 请求接口
// 请求接口
import
{
passwordEmailCode
}
from
"
r/index
/register
"
;
import
{
passwordCode
}
from
"
r/base
/register
"
;
import
{
changePassCode
}
from
"
r/index
/login
"
;
import
{
changePassCode
}
from
"
r/base
/login
"
;
import
{
mobileCheck
}
from
"
@/common/utils.js
"
;
import
{
mobileCheck
}
from
"
@/common/utils.js
"
;
import
{
intervalTime
}
from
"
store/time
"
;
import
{
intervalTime
}
from
"
store/time
"
;
import
validator
from
"
common/validator
"
;
import
validator
from
"
common/validator
"
;
export
default
{
export
default
{
name
:
"
index
-reset
"
,
name
:
"
base
-reset
"
,
data
()
{
data
()
{
const
pwdCheck
=
async
(
rule
,
value
,
callback
)
=>
{
const
pwdCheck
=
async
(
rule
,
value
,
callback
)
=>
{
if
(
value
!==
this
.
resetForm
.
password
)
{
if
(
value
!==
this
.
resetForm
.
password
)
{
...
@@ -132,7 +129,7 @@ export default {
...
@@ -132,7 +129,7 @@ export default {
isShowPwd
:
true
,
// 控制密码显示隐藏
isShowPwd
:
true
,
// 控制密码显示隐藏
resetForm
:
{
resetForm
:
{
phone
:
""
,
phone
:
""
,
email
:
""
,
//
email: "",
code
:
""
,
code
:
""
,
password
:
""
,
password
:
""
,
rq_password
:
""
,
rq_password
:
""
,
...
@@ -154,13 +151,13 @@ export default {
...
@@ -154,13 +151,13 @@ export default {
},
},
],
],
// 对邮箱验证
// 对邮箱验证
email
:
[
//
email: [
{
required
:
true
,
message
:
"
请输入邮箱
"
,
trigger
:
"
blur
"
},
//
{ required: true, message: "请输入邮箱", trigger: "blur" },
{
//
{
validator
:
validator
.
validateEmail
,
//
validator: validator.validateEmail,
trigger
:
"
blur
"
,
//
trigger: "blur",
},
//
},
],
//
],
// 对验证码进行校验
// 对验证码进行校验
code
:
[
code
:
[
{
required
:
true
,
message
:
"
请输入验证码
"
,
trigger
:
"
blur
"
},
{
required
:
true
,
message
:
"
请输入验证码
"
,
trigger
:
"
blur
"
},
...
@@ -211,9 +208,8 @@ export default {
...
@@ -211,9 +208,8 @@ export default {
};
};
},
},
created
()
{
created
()
{
const
code
=
this
.
$store
.
state
.
indexIdentity
;
const
endTime
=
window
.
localStorage
.
getItem
(
"
restet_code_time
"
);
const
endTime
=
window
.
localStorage
.
getItem
(
"
restet_code_time
"
+
code
);
const
phone
=
window
.
localStorage
.
getItem
(
"
restet_code_phone
"
);
const
phone
=
window
.
localStorage
.
getItem
(
"
restet_code_phone
"
+
code
);
if
(
endTime
&&
Number
(
endTime
)
>
new
Date
().
getTime
())
{
if
(
endTime
&&
Number
(
endTime
)
>
new
Date
().
getTime
())
{
this
.
resetForm
.
phone
=
phone
;
this
.
resetForm
.
phone
=
phone
;
this
.
intervalHandle
(
new
Date
(),
Number
(
endTime
));
this
.
intervalHandle
(
new
Date
(),
Number
(
endTime
));
...
@@ -222,8 +218,7 @@ export default {
...
@@ -222,8 +218,7 @@ export default {
methods
:
{
methods
:
{
// 去注册
// 去注册
toLogin
()
{
toLogin
()
{
let
code
=
this
.
$store
.
state
.
indexIdentity
;
this
.
$router
.
push
(
"
/baseLogin
"
);
this
.
$router
.
push
(
"
/login?code=
"
+
code
);
},
},
// 改变密码显示状态
// 改变密码显示状态
changePwdStatus
()
{
changePwdStatus
()
{
...
@@ -250,16 +245,16 @@ export default {
...
@@ -250,16 +245,16 @@ export default {
},
},
// 获取手机验证短信
// 获取手机验证短信
getCode
()
{
getCode
()
{
if
(
!
this
.
resetForm
.
email
)
{
if
(
!
this
.
resetForm
.
phone
)
{
return
this
.
$message
.
error
(
"
请输入邮箱
"
);
return
this
.
$message
.
error
(
"
请输入手机号
"
);
}
}
// if (!this.codeTime) {
// if (!this.codeTime) {
// return this.$message.error("您已经获取验证码,请去邮箱中进行查看");
// return this.$message.error("您已经获取验证码,请去邮箱中进行查看");
// }
// }
// 接口获得验证码
// 接口获得验证码
passwordEmail
Code
({
password
Code
({
phone
:
this
.
resetForm
.
phone
,
phone
:
this
.
resetForm
.
phone
,
email
:
this
.
resetForm
.
email
,
//
email: this.resetForm.email,
}).
then
((
res
)
=>
{
}).
then
((
res
)
=>
{
console
.
log
(
res
,
"
passwordCode
"
);
console
.
log
(
res
,
"
passwordCode
"
);
if
(
res
.
data
.
code
!=
200
)
{
if
(
res
.
data
.
code
!=
200
)
{
...
@@ -268,9 +263,8 @@ export default {
...
@@ -268,9 +263,8 @@ export default {
this
.
$message
.
success
(
res
.
data
.
message
);
this
.
$message
.
success
(
res
.
data
.
message
);
this
.
codeTime
=
res
.
data
.
data
.
now
*
1000
;
this
.
codeTime
=
res
.
data
.
data
.
now
*
1000
;
// console.log(this.codeTime)
// console.log(this.codeTime)
let
code
=
this
.
$store
.
state
.
indexIdentity
;
window
.
localStorage
.
setItem
(
window
.
localStorage
.
setItem
(
"
restet_code_time
"
+
code
,
"
restet_code_time
"
,
res
.
data
.
data
.
now
*
1000
res
.
data
.
data
.
now
*
1000
);
);
this
.
intervalHandle
(
new
Date
(),
res
.
data
.
data
.
now
*
1000
);
this
.
intervalHandle
(
new
Date
(),
res
.
data
.
data
.
now
*
1000
);
...
@@ -294,23 +288,22 @@ export default {
...
@@ -294,23 +288,22 @@ export default {
}
}
this
.
$message
.
success
(
res
.
data
.
message
);
this
.
$message
.
success
(
res
.
data
.
message
);
// token存储
// token存储
let
code
=
this
.
$store
.
state
.
indexIdentity
;
// window.localStorage.setItem("index-token" + code, res.token);
// window.localStorage.setItem("index-token" + code, res.token);
window
.
localStorage
.
setItem
(
window
.
localStorage
.
setItem
(
"
restet_code_phone
"
+
code
,
"
restet_code_phone
"
,
this
.
resetForm
.
phone
this
.
resetForm
.
phone
);
);
this
.
$router
.
push
(
"
/login?code=
"
+
code
);
this
.
$router
.
replace
(
"
/baseLogin
"
);
});
});
});
});
},
},
},
},
};
};
</
script
>
</
script
>
<
style
scoped
lang=
"scss"
>
<
style
scoped
lang=
"scss"
>
// 注册输入
// 注册输入
.container
{
.container
{
background
:
#ffffff
;
background
:
#ffffff
;
box-shadow
:
0px
1px
18px
0px
rgba
(
0
,
0
,
0
,
0
.06
);
box-shadow
:
0px
1px
18px
0px
rgba
(
0
,
0
,
0
,
0
.06
);
border-radius
:
8px
;
border-radius
:
8px
;
...
@@ -319,21 +312,22 @@ export default {
...
@@ -319,21 +312,22 @@ export default {
overflow
:
hidden
;
overflow
:
hidden
;
.title
{
.title
{
margin
:
19px
0
6px
0
;
//
margin: 19px 0 6px 0;
width
:
132px
;
//
width: 132px;
height
:
20px
;
height
:
20px
;
font-size
:
22px
;
font-size
:
22px
;
font-weight
:
500
;
font-weight
:
500
;
color
:
var
(
--
color
);
color
:
var
(
--
color
);
line-height
:
20px
;
line-height
:
20px
;
text-align
:
center
;
}
}
.line
{
//
.line {
width
:
83px
;
//
width: 83px;
height
:
3px
;
//
height: 3px;
background
:
var
(
--
color
);
//
background: var(--color);
border-radius
:
2px
;
//
border-radius: 2px;
}
//
}
::v-deep
.el-form
{
::v-deep
.el-form
{
margin-top
:
60px
;
margin-top
:
60px
;
...
@@ -434,23 +428,23 @@ export default {
...
@@ -434,23 +428,23 @@ export default {
}
}
}
}
}
}
}
}
@media
screen
and
(
max-width
:
1601px
)
{
@media
screen
and
(
max-width
:
1601px
)
{
.container
{
.container
{
right
:
18%
;
right
:
18%
;
}
}
}
}
@media
screen
and
(
max-width
:
1501px
)
{
@media
screen
and
(
max-width
:
1501px
)
{
.container
{
.container
{
right
:
16%
;
right
:
16%
;
}
}
}
}
@media
screen
and
(
max-width
:
1401px
)
{
@media
screen
and
(
max-width
:
1401px
)
{
.container
{
.container
{
right
:
14%
;
right
:
14%
;
}
}
}
}
</
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