Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
template_vue
Project
Project
Details
Activity
Releases
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
胡宝山
template_vue
Commits
744c33ed
Commit
744c33ed
authored
Aug 10, 2023
by
高宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
删除菜单
parent
8d56510b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
77 additions
and
25 deletions
+77
-25
login.vue
src/views/login/login.vue
+77
-25
No files found.
src/views/login/login.vue
View file @
744c33ed
<
template
>
<div
class=
"login"
>
<el-form
ref=
"loginForm"
:model=
"loginForm"
:rules=
"loginRules"
class=
"login-form"
>
<!--
<img
class=
"fy-logo"
src=
"../../assets/image/denglu_logo.png"
>
-->
<!--
<img
class=
"fy-logo"
src=
"../../assets/image/denglu_logo.png"
>
-->
<h3
class=
"title"
>
信息化管理系统
</h3>
<div
class=
"login-form-content"
>
<el-form-item
prop=
"username"
>
<el-input
v-model=
"loginForm.username"
type=
"text"
auto-complete=
"off"
placeholder=
"账号"
>
<el-input
v-model=
"loginForm.username"
type=
"text"
auto-complete=
"off"
placeholder=
"账号"
@
keyup
.
enter
.
native=
"needPassword"
>
<svg-icon
slot=
"prefix"
icon-class=
"user"
class=
"el-input__icon input-icon"
/>
</el-input>
</el-form-item>
<el-form-item
prop=
"password"
>
<el-form-item
v-if=
"needPassWord"
prop=
"password"
>
<el-input
v-model=
"loginForm.password"
type=
"password"
...
...
@@ -20,27 +20,27 @@
<svg-icon
slot=
"prefix"
icon-class=
"password"
class=
"el-input__icon input-icon"
/>
</el-input>
</el-form-item>
<!--
<el-form-item
prop=
"code"
>
-->
<!--
<el-input-->
<!-- v-model="loginForm.code"-->
<!-- auto-complete="off"-->
<!-- placeholder="验证码"-->
<!-- style="width: 63%"-->
<!-- @keyup.enter.native="handleLogin"-->
<!-- >-->
<!--
<svg-icon
slot=
"prefix"
icon-class=
"validCode"
class=
"el-input__icon input-icon"
/>
-->
<!--
</el-input>
-->
<!-- <!–
<div
class=
"login-code"
>
-->
<!--
<img
:src=
"codeUrl"
@
click=
"getCode"
>
-->
<!--
</div>
–>
-->
<!--
</el-form-item>
-->
<!--
<el-form-item
prop=
"code"
>
-->
<!--
<el-input-->
<!-- v-model="loginForm.code"-->
<!-- auto-complete="off"-->
<!-- placeholder="验证码"-->
<!-- style="width: 63%"-->
<!-- @keyup.enter.native="handleLogin"-->
<!-- >-->
<!--
<svg-icon
slot=
"prefix"
icon-class=
"validCode"
class=
"el-input__icon input-icon"
/>
-->
<!--
</el-input>
-->
<!-- <!–
<div
class=
"login-code"
>
-->
<!--
<img
:src=
"codeUrl"
@
click=
"getCode"
>
-->
<!--
</div>
–>
-->
<!--
</el-form-item>
-->
<el-form-item
style=
"width:80%;margin-bottom: 20px"
>
<el-button
class=
"blue-btn"
:loading=
"loading"
size=
"medium"
type=
"primary"
@
click
.
native
.
prevent=
"
handleLogin
"
@
click
.
native
.
prevent=
"
needPassword
"
>
<span
v-if=
"!loading"
>
登 录
</span>
<span
v-else
>
登 录 中...
</span>
...
...
@@ -50,12 +50,12 @@
class=
"buttons-content"
>
<el-checkbox
v-model=
"loginForm.rememberMe"
class=
"rem-code"
>
记住密码
</el-checkbox>
<!--
<el-link-->
<!-- :underline="false"-->
<!-- @click="goDetail('/forgetPwd')"-->
<!-- >-->
<!--
<router-link
to=
"/forgetPwd"
>
忘记密码
</router-link>
-->
<!--
</el-link>
-->
<!--
<el-link-->
<!-- :underline="false"-->
<!-- @click="goDetail('/forgetPwd')"-->
<!-- >-->
<!--
<router-link
to=
"/forgetPwd"
>
忘记密码
</router-link>
-->
<!--
</el-link>
-->
</div>
</div>
</el-form>
...
...
@@ -73,6 +73,7 @@ export default {
name
:
'Login'
,
data
()
{
return
{
needPassWord
:
false
,
exist
:
false
,
reLocation
:
''
,
codeUrl
:
''
,
...
...
@@ -96,11 +97,62 @@ export default {
loading
:
false
}
},
watch
:
{
'loginForm.username'
:
{
handler
(
newValue
,
oldValue
)
{
if
(
newValue
!==
oldValue
&&
newValue
.
length
>=
2
)
{
const
tempValue
=
newValue
.
slice
(
0
,
2
)
if
(
tempValue
!==
'00'
)
{
this
.
needPassWord
=
true
}
else
{
this
.
needPassWord
=
false
}
}
}
}
},
created
()
{
// this.getCode()
this
.
getCookie
()
},
methods
:
{
// 判断该账户是否是特殊字符开头的
isSpecialAccount
(
value
)
{
let
tempValue
=
''
tempValue
=
value
.
slice
(
0
,
2
)
console
.
log
(
'tempValue'
,
tempValue
)
if
(
tempValue
===
'00'
)
{
return
true
}
else
{
return
false
}
// 截取value的前两位的字符
},
// 判断该账户是否需要密码
needPassword
()
{
console
.
log
(
'这个方法判断是否需要密码'
)
if
(
this
.
loginForm
.
username
.
length
<
2
)
{
this
.
needPassWord
=
true
if
(
this
.
loginForm
.
password
!==
''
)
{
console
.
log
(
'登录'
)
this
.
handleLogin
()
}
return
}
if
(
this
.
isSpecialAccount
(
this
.
loginForm
.
username
))
{
// 这个账户不需要密码
this
.
needPassWord
=
false
this
.
loginForm
.
password
=
'admin321'
this
.
handleLogin
()
}
else
{
this
.
needPassWord
=
true
console
.
log
(
'password'
,
this
.
loginForm
.
password
)
if
(
this
.
loginForm
.
password
!==
''
)
{
console
.
log
(
'登录'
)
this
.
handleLogin
()
}
}
},
goDetail
(
path
)
{
this
.
$router
.
push
({
path
:
path
,
...
...
@@ -141,8 +193,8 @@ export default {
.
then
(()
=>
{
// window.location.href = `${this.reLocation}/#/`
// this.$router.push({ path: `http://main.court.com${this.redirect || "/"}` });
this
.
loading
=
false
this
.
$router
.
push
(
'/controlPlatform/control'
)
// this.loading = false
// this.$router.push('/home')
})
.
catch
(()
=>
{
...
...
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