Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
liyeyun
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
cfld-frontend
liyeyun
Commits
8fff2eb0
Commit
8fff2eb0
authored
Dec 14, 2023
by
shilei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 登录验证、面包屑去除市
parent
77f8fa50
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
19 deletions
+36
-19
DetailMain.vue
src/components/detail/DetailMain.vue
+1
-1
LoginView.vue
src/components/login/LoginView.vue
+35
-18
No files found.
src/components/detail/DetailMain.vue
View file @
8fff2eb0
...
...
@@ -200,7 +200,7 @@ const breadcrumbs = computed(() => {
searchParams
:
{},
},
{
name
:
getName
(
provinceName
),
name
:
getName
(
provinceName
)
.
replace
(
'市'
,
''
)
,
searchParams
:
{
provinceName
},
},
{
...
...
src/components/login/LoginView.vue
View file @
8fff2eb0
...
...
@@ -20,6 +20,7 @@
type=
"number"
maxlength=
"11"
placeholder=
"请输入手机号"
@
blur=
"verify('phone')"
></ElInput>
</div>
<div
class=
"form-item flex justify-between"
>
...
...
@@ -64,6 +65,7 @@
type=
"number"
maxlength=
"11"
placeholder=
"请输入手机号"
@
blur=
"verify('phone')"
/>
</div>
<div
class=
"form-item flex"
ref=
"passWord"
>
...
...
@@ -72,6 +74,7 @@
type=
"password"
show-password
placeholder=
"请输入密码"
@
blur=
"verify('password')"
></ElInput>
</div>
</div>
...
...
@@ -106,6 +109,7 @@
type=
"number"
maxlength=
"11"
placeholder=
"请输入手机号"
@
blur=
"verify('phone')"
></ElInput>
</div>
<div
class=
"form-item flex justify-between"
>
...
...
@@ -126,6 +130,7 @@
type=
"password"
show-password
placeholder=
"请输入密码(最少6位)"
@
blur=
"verify('password')"
></ElInput>
</div>
</div>
...
...
@@ -156,6 +161,7 @@
maxlength=
"11"
type=
"number"
placeholder=
"请输入手机号"
@
blur=
"verify('phone')"
></ElInput>
</div>
<div
class=
"form-item flex justify-between"
>
...
...
@@ -176,6 +182,7 @@
type=
"password"
show-password
placeholder=
"请输入密码(最少6位)"
@
blur=
"verify('password')"
></ElInput>
</div>
</div>
...
...
@@ -255,23 +262,33 @@ const request = (url: any) => {
});
requestFn
=
r
.
request
;
};
const
verify
=
()
=>
{
const
verify
=
(
type
:
string
=
'all'
)
=>
{
const
regex
=
/^1
[
3-9
]\d{9}
$/
;
if
(
!
regex
.
test
(
phoneNum
.
value
?.
toString
()
||
''
))
{
proxy
.
$refs
.
phoneInput
.
style
.
borderColor
=
'#c0322b'
;
errorMsg
.
value
=
'请输入有效的手机号码'
;
return
false
;
}
else
{
proxy
.
$refs
.
phoneInput
.
style
.
borderColor
=
'rgba(0, 0, 0, 0.15)'
;
}
// const
if
(
modalType
.
value
!==
'loginByPhone'
)
{
if
(
!
/^.
{6,20}
$/
.
test
(
password
.
value
?.
toString
()
||
''
))
{
proxy
.
$refs
.
passWord
.
style
.
borderColor
=
'#c0322b'
;
errorMsg
.
value
=
'请输入6-20位有效密码'
;
if
(
type
===
'phone'
||
type
===
'all'
)
{
if
(
!
regex
.
test
(
phoneNum
.
value
?.
toString
()
||
''
))
{
proxy
.
$refs
.
phoneInput
.
style
.
borderColor
=
'#c0322b'
;
errorMsg
.
value
=
'请输入有效的手机号码'
;
return
false
;
}
else
{
proxy
.
$refs
.
passWord
.
style
.
borderColor
=
'rgba(0, 0, 0, 0.15)'
;
if
(
errorMsg
.
value
===
'请输入有效的手机号码'
)
{
errorMsg
.
value
=
null
;
}
proxy
.
$refs
.
phoneInput
.
style
.
borderColor
=
'rgba(0, 0, 0, 0.15)'
;
}
}
// const
if
(
type
===
'password'
||
type
===
'all'
)
{
if
(
modalType
.
value
!==
'loginByPhone'
)
{
if
(
!
/^.
{6,20}
$/
.
test
(
password
.
value
?.
toString
()
||
''
))
{
proxy
.
$refs
.
passWord
.
style
.
borderColor
=
'#c0322b'
;
errorMsg
.
value
=
'请输入6-20位有效密码'
;
return
false
;
}
else
{
if
(
errorMsg
.
value
===
'请输入6-20位有效密码'
)
{
errorMsg
.
value
=
null
;
}
proxy
.
$refs
.
passWord
.
style
.
borderColor
=
'rgba(0, 0, 0, 0.15)'
;
}
}
}
return
true
;
...
...
@@ -282,7 +299,7 @@ const verify = () => {
const
login
=
debounce
(
async
()
=>
{
errorMsg
.
value
=
null
;
if
(
!
verify
())
{
if
(
!
verify
(
'all'
))
{
return
;
}
const
url
:
string
=
...
...
@@ -315,7 +332,7 @@ const login = debounce(
const
sendMessage
=
debounce
(
async
()
=>
{
errorMsg
.
value
=
null
;
if
(
!
verify
()
||
interval
.
value
!==
0
)
{
if
(
!
verify
(
'all'
)
||
interval
.
value
!==
0
)
{
return
;
}
const
sendType
:
any
=
{
...
...
@@ -354,7 +371,7 @@ const sendMessage = debounce(
*/
const
resetPassWord
=
async
()
=>
{
errorMsg
.
value
=
null
;
if
(
!
verify
())
{
if
(
!
verify
(
'all'
))
{
return
;
}
request
(
RequestUrl
.
forget
);
...
...
@@ -376,7 +393,7 @@ const resetPassWord = async () => {
*/
const
register
=
async
()
=>
{
errorMsg
.
value
=
null
;
if
(
!
verify
())
{
if
(
!
verify
(
'all'
))
{
return
;
}
if
(
!
agree
.
value
.
length
)
{
...
...
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