Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dsk-cr20g
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
Administrator
dsk-cr20g
Commits
1fa4e51f
Commit
1fa4e51f
authored
Sep 06, 2023
by
huangjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登录
parent
2d41c37d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
153 additions
and
76 deletions
+153
-76
phone.png
dsk-operate-ui/src/assets/images/phone.png
+0
-0
safe.png
dsk-operate-ui/src/assets/images/safe.png
+0
-0
title_icon.png
dsk-operate-ui/src/assets/images/title_icon.png
+0
-0
txyzm.png
dsk-operate-ui/src/assets/images/txyzm.png
+0
-0
login.vue
dsk-operate-ui/src/views/login.vue
+153
-76
No files found.
dsk-operate-ui/src/assets/images/phone.png
0 → 100644
View file @
1fa4e51f
574 Bytes
dsk-operate-ui/src/assets/images/safe.png
0 → 100644
View file @
1fa4e51f
3.23 KB
dsk-operate-ui/src/assets/images/title_icon.png
deleted
100644 → 0
View file @
2d41c37d
2.19 KB
dsk-operate-ui/src/assets/images/txyzm.png
0 → 100644
View file @
1fa4e51f
464 Bytes
dsk-operate-ui/src/views/login.vue
View file @
1fa4e51f
...
...
@@ -5,8 +5,67 @@
<img
class=
"logo"
src=
"../assets/images/logo1.png"
/>
<img
class=
"img"
src=
"../assets/images/login/img.png"
/>
</div>
<el-form
v-if=
"!islog && !islang"
ref=
"loginForm"
:model=
"loginForm"
:rules=
"loginRules"
class=
"login-form"
>
<h3
class=
"title"
><img
src=
"../assets/images/title_icon.png"
/>
欢迎登录系统
</h3>
<!--快捷登录-->
<el-form
v-if=
"!islog && !islang && isDXlogin"
ref=
"dxform"
:model=
"dxform"
:rules=
"dxRules"
class=
"login-form"
>
<div
class=
"logintitle"
>
<div
class=
"on"
@
click=
"isDXlogin = true"
>
快捷登录
</div>
<div
@
click=
"isDXlogin = false"
>
密码登录
</div>
</div>
<el-form-item
prop=
"phonenumber"
>
<el-input
v-model=
"dxform.phonenumber"
type=
"text"
auto-complete=
"off"
placeholder=
"请输入手机号码"
>
<img
class=
"img"
slot=
"prefix"
src=
"../assets/images/phone.png"
/>
</el-input>
</el-form-item>
<el-form-item
prop=
"captchaCode"
v-if=
"captchaEnabled"
>
<el-input
v-model=
"dxform.captchaCode"
auto-complete=
"off"
placeholder=
"请输入图形验证码"
style=
"width: 196px;float: left;"
>
<img
class=
"img"
slot=
"prefix"
src=
"../assets/images/txyzm.png"
/>
</el-input>
<div
class=
"login-code"
>
<img
:src=
"codeUrl"
@
click=
"getCode"
class=
"login-code-img"
/>
</div>
</el-form-item>
<el-form-item
prop=
"smsCode"
>
<el-input
v-model=
"dxform.smsCode"
auto-complete=
"off"
placeholder=
"请输入验证码"
style=
"width: 196px;float: left;"
@
keyup
.
enter
.
native=
"dxLogin"
>
<img
class=
"img"
slot=
"prefix"
src=
"../assets/images/validCode.png"
/>
</el-input>
<div
class=
"login-code"
>
<div
class=
"hqyzm"
@
click=
"getsms"
>
{{
smstitle
}}
</div>
</div>
</el-form-item>
<el-form-item
style=
"width:100%;margin-top: 42px"
>
<el-button
size=
"medium"
type=
"primary"
style=
"width:100%;height: 48px;border-radius: 4px;font-size: 16px;"
@
click
.
native
.
prevent=
"dxLogin"
>
<span
v-if=
"!loading"
>
确认
</span>
<span
v-else
>
登 录 中...
</span>
</el-button>
</el-form-item>
</el-form>
<!--密码登录-->
<el-form
v-if=
"!islog && !islang && !isDXlogin"
ref=
"loginForm"
:model=
"loginForm"
:rules=
"loginRules"
class=
"login-form"
>
<div
class=
"logintitle"
>
<div
@
click=
"isDXlogin = true"
>
快捷登录
</div>
<div
class=
"on"
@
click=
"isDXlogin = false"
>
密码登录
</div>
</div>
<el-form-item
prop=
"username"
>
<el-input
v-model=
"loginForm.username"
...
...
@@ -32,18 +91,17 @@
<el-input
v-model=
"loginForm.code"
auto-complete=
"off"
placeholder=
"请输入验证码"
style=
"width:
56%
;float: left;"
placeholder=
"请输入
图形
验证码"
style=
"width:
196px
;float: left;"
@
keyup
.
enter
.
native=
"handleLogin"
>
<img
class=
"img"
slot=
"prefix"
src=
"../assets/images/
validCode
.png"
/>
<img
class=
"img"
slot=
"prefix"
src=
"../assets/images/
txyzm
.png"
/>
</el-input>
<div
class=
"login-code"
>
<img
:src=
"codeUrl"
@
click=
"getCode"
class=
"login-code-img"
/>
</div>
</el-form-item>
<el-checkbox
v-model=
"loginForm.rememberMe"
style=
"margin:0px 0px 25px 48px;"
>
记住密码
</el-checkbox>
<el-form-item
style=
"width:100%;"
>
<el-form-item
style=
"width:100%;margin-top: 42px;"
>
<el-button
:loading=
"loading"
size=
"medium"
...
...
@@ -51,25 +109,22 @@
style=
"width:100%;height: 48px;border-radius: 4px;font-size: 16px;"
@
click
.
native
.
prevent=
"handleLogin"
>
<span
v-if=
"!loading"
>
登
录
</span>
<span
v-if=
"!loading"
>
登录
</span>
<span
v-else
>
登 录 中...
</span>
</el-button>
<!--
<div
style=
"float: right;"
v-if=
"register"
>
-->
<!--
<router-link
class=
"link-type"
:to=
"'/register'"
>
立即注册
</router-link>
-->
<!--
</div>
-->
</el-form-item>
</el-form>
<!--安全验证-->
<el-form
v-if=
"!islog && islang"
ref=
"dxform"
:model=
"dxform"
:rules=
"dxRules"
class=
"login-form"
>
<h3
class=
"title"
><img
src=
"../assets/images/title_icon.png"
/>
欢迎登录系统
</h3>
<h4>
安全验证
</h4>
<h3
class=
"title"
><img
src=
"../assets/images/safe.png"
/>
请完成安全验证
</h3>
<el-form-item
prop=
"phonenumber"
>
<el-input
v-model=
"dxform.phonenumber"
type=
"text"
auto-complete=
"off"
placeholder=
"请输入
登录账号
"
placeholder=
"请输入
手机号码
"
>
<img
class=
"img"
slot=
"prefix"
src=
"../assets/images/
user
.png"
/>
<img
class=
"img"
slot=
"prefix"
src=
"../assets/images/
phone
.png"
/>
</el-input>
</el-form-item>
<el-form-item
prop=
"captchaCode"
v-if=
"captchaEnabled && showcode"
>
...
...
@@ -77,32 +132,40 @@
v-model=
"dxform.captchaCode"
auto-complete=
"off"
placeholder=
"请输入验证码"
style=
"width:
56%
;float: left;"
style=
"width:
196px
;float: left;"
>
<img
class=
"img"
slot=
"prefix"
src=
"../assets/images/
validCode
.png"
/>
<img
class=
"img"
slot=
"prefix"
src=
"../assets/images/
txyzm
.png"
/>
</el-input>
<div
class=
"login-code"
>
<img
:src=
"codeUrl"
@
click=
"getCode"
class=
"login-code-img"
/>
</div>
</el-form-item>
<el-form-item
prop=
"captchaCode"
>
<div
style=
"margin-top: 15px;"
>
<el-input
placeholder=
"请输入短信验证码"
v-model=
"dxform.smsCode"
@
keyup
.
enter
.
native=
"dxLogin"
>
<template
slot=
"append"
><div
@
click=
"getsms"
>
{{
smstitle
}}
</div></
template
>
</el-input>
<el-form-item
prop=
"smsCode"
>
<el-input
v-model=
"dxform.smsCode"
auto-complete=
"off"
placeholder=
"请输入验证码"
style=
"width: 196px;float: left;"
@
keyup
.
enter
.
native=
"dxLogin"
>
<img
class=
"img"
slot=
"prefix"
src=
"../assets/images/validCode.png"
/>
</el-input>
<div
class=
"login-code"
>
<div
class=
"hqyzm"
@
click=
"getsms"
>
{{
smstitle
}}
</div>
</div>
</el-form-item>
<el-form-item
style=
"width:100%;"
>
<el-form-item
style=
"width:100%;
margin-top: 42px
"
>
<el-button
size=
"medium"
type=
"primary"
style=
"width:100%;height: 48px;border-radius: 4px;font-size: 16px;"
@
click
.
native
.
prevent=
"dxLogin"
>
<span>
确
定
</span>
<span>
确
认
</span>
</el-button>
</el-form-item>
</el-form>
<!--选择租户企业-->
<div
v-if=
"islog"
class=
"login-form choose-form"
>
<h3
class=
"title i"
><img
src=
"../assets/images/login/title_choose.png"
/>
请选择你想要登录的企业
</h3>
<div
class=
"enterpriselist"
>
...
...
@@ -117,7 +180,6 @@
<
script
>
import
store
from
'@/store'
import
{
changeTenants
,
defaultTenantid
,
getCodeImg
,
getTenants
,
userTenantList
,
logincaptchaSms
,
smsLogin
}
from
'@/api/login'
import
Cookies
from
'js-cookie'
import
{
decrypt
,
encrypt
}
from
'@/utils/jsencrypt'
import
{
Base64
}
from
'js-base64'
import
{
getTenantid
,
setTenantid
,
setToken
}
from
'@/utils/auth'
...
...
@@ -128,11 +190,11 @@
return
{
tenantId
:
-
1
,
islog
:
false
,
isDXlogin
:
true
,
codeUrl
:
""
,
loginForm
:
{
username
:
""
,
password
:
""
,
rememberMe
:
false
,
code
:
""
,
uuid
:
""
},
...
...
@@ -173,6 +235,7 @@
smstime
:
60
,
smstitle
:
'获取验证码'
,
showcode
:
false
,
//是否展示验证码
};
},
watch
:
{
...
...
@@ -181,11 +244,16 @@
this
.
redirect
=
route
.
query
&&
route
.
query
.
redirect
;
},
immediate
:
true
},
isDXlogin
(){
this
.
resetForm
(
'dxform'
)
this
.
resetForm
(
'loginForm'
)
this
.
getCode
()
}
},
created
()
{
this
.
getCode
();
this
.
getCookie
();
},
methods
:
{
getCode
()
{
...
...
@@ -198,17 +266,6 @@
}
});
},
getCookie
()
{
const
username
=
Cookies
.
get
(
"username"
);
const
password
=
Cookies
.
get
(
"password"
);
const
rememberMe
=
Cookies
.
get
(
'rememberMe'
)
this
.
loginForm
=
{
username
:
username
===
undefined
?
this
.
loginForm
.
username
:
username
,
// password: password === undefined ? this.loginForm.password : decrypt(password),
password
:
password
===
undefined
?
this
.
loginForm
.
password
:
Base64
.
encode
(
password
),
rememberMe
:
rememberMe
===
undefined
?
false
:
Boolean
(
rememberMe
)
};
},
getsms
(){
logincaptchaSms
(
this
.
dxform
).
then
(
res
=>
{
console
.
log
(
res
)
...
...
@@ -216,7 +273,7 @@
this
.
$message
.
success
(
'已发送短信!'
)
let
_this
=
this
this
.
timers
=
setInterval
(()
=>
{
_this
.
smstitle
=
'剩余'
+
_this
.
smstime
+
'S
'
_this
.
smstitle
=
_this
.
smstime
+
'秒后重试
'
_this
.
smstime
--
;
if
(
_this
.
smstime
<=
0
){
_this
.
smstitle
=
'发送验证码'
...
...
@@ -224,7 +281,7 @@
}
},
1000
)
}
else
{
this
.
$message
.
error
(
'短信发送失败!'
)
this
.
$message
.
error
(
res
.
msg
)
this
.
getCode
()
this
.
showcode
=
true
}
...
...
@@ -236,16 +293,6 @@
this
.
$refs
.
loginForm
.
validate
(
valid
=>
{
if
(
valid
)
{
this
.
loading
=
true
;
if
(
this
.
loginForm
.
rememberMe
)
{
Cookies
.
set
(
"username"
,
this
.
loginForm
.
username
,
{
expires
:
30
});
// Cookies.set("password", encrypt(this.loginForm.password), { expires: 30 });
Cookies
.
set
(
"password"
,
Base64
.
encode
(
this
.
loginForm
.
password
),
{
expires
:
30
});
Cookies
.
set
(
'rememberMe'
,
this
.
loginForm
.
rememberMe
,
{
expires
:
30
});
}
else
{
Cookies
.
remove
(
"username"
);
Cookies
.
remove
(
"password"
);
Cookies
.
remove
(
'rememberMe'
);
}
let
froms
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
loginForm
))
froms
.
password
=
Base64
.
encode
(
this
.
loginForm
.
password
)
//密码登录时根据手机号获取是否有多个租户
...
...
@@ -267,20 +314,6 @@
});
}
})
// this.$store.dispatch("Login", froms).then(() => {
// defaultTenantid().then(res=>{
// if(res.data.tenantId == "" || res.data.tenantId == null){//无默认企业id
// this.goin()
// }else{
// this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
// }
// })
// }).catch(() => {
// this.loading = false;
// if (this.captchaEnabled) {
// this.getCode();
// }
// });
}
});
},
...
...
@@ -292,13 +325,13 @@
froms
.
phonenumber
=
this
.
dxform
.
phonenumber
froms
.
smsCode
=
this
.
dxform
.
smsCode
smsLogin
(
JSON
.
stringify
(
froms
)).
then
(
res
=>
{
setToken
(
res
.
data
.
token
)
store
.
commit
(
'SET_TOKEN'
,
res
.
data
.
token
)
setTenantid
(
res
.
data
.
tenantId
)
defaultTenantid
().
then
(
res
=>
{
if
(
res
.
data
.
tenantId
==
""
||
res
.
data
.
tenantId
==
null
){
//无默认企业id
this
.
goin
()
}
else
{
setToken
(
res
.
data
.
accessToken
)
store
.
commit
(
'SET_TOKEN'
,
res
.
data
.
accessToken
)
setTenantid
(
res
.
data
.
tenantId
)
this
.
$router
.
push
({
path
:
this
.
redirect
||
"/"
}).
catch
(()
=>
{});
}
})
...
...
@@ -367,15 +400,17 @@
}
}
.title
{
padding
:
4
6px
0
32
px
48px
;
padding
:
4
0px
0
25
px
48px
;
border-bottom
:
1px
solid
#F0F0F0
;
font-size
:
22px
;
font-size
:
18px
;
line-height
:
26px
;
color
:
#232323
;
margin
:
0
0
32px
0
;
img
{
width
:
17px
;
height
:
17px
;
margin-bottom
:
3px
;
width
:
24px
;
height
:
24px
;
margin-right
:
12px
;
float
:
left
;
}
&
.i
{
padding
:
40px
0
40px
20px
;
...
...
@@ -394,11 +429,12 @@
}
.login-form
{
border-radius
:
6
px
;
border-radius
:
10
px
;
background
:
#ffffff
;
width
:
420px
;
float
:
right
;
margin-top
:
70px
;
padding-bottom
:
72px
;
/*padding: 25px 25px 5px 25px;*/
.el-form-item
{
padding
:
0
48px
;
...
...
@@ -408,13 +444,14 @@
width
:
324px
;
height
:
48px
;
background
:
#F2F4F9
;
border-radius
:
4px
;
input
{
height
:
48px
;
background
:
#F2F4F9
;
font-size
:
14px
;
}
.el-input__inner
{
padding-left
:
73
px
;
padding-left
:
61
px
;
border
:
0
;
}
}
...
...
@@ -422,11 +459,39 @@
border-right
:
1px
solid
#D8D8D8
;
height
:
24px
;
margin
:
12px
0
;
left
:
0
;
width
:
48px
;
}
.img
{
height
:
24px
;
width
:
24px
;
margin
:
0
14px
0
12px
;
margin
:
0
12px
;
}
.logintitle
{
border-bottom
:
1px
solid
#F0F0F0
;
margin-bottom
:
48px
;
padding
:
50px
48px
14px
;
box-sizing
:
border-box
;
>
div
{
display
:
inline-block
;
font-size
:
18px
;
line-height
:
26px
;
margin-right
:
40px
;
color
:
#81878F
;
position
:
relative
;
cursor
:
pointer
;
&
.on
{
color
:
#232323
;
&
:after
{
content
:
' '
;
width
:
29px
;
height
:
3px
;
background
:
#0081FF
;
position
:
absolute
;
margin
:
37px
-47px
;
}
}
}
}
}
.login-tip
{
...
...
@@ -438,11 +503,22 @@
width
:
33%
;
height
:
38px
;
float
:
left
;
margin-left
:
1
6
px
;
margin-left
:
1
4
px
;
img
{
cursor
:
pointer
;
vertical-align
:
middle
;
}
.hqyzm
{
width
:
116px
;
height
:
48px
;
border-radius
:
4px
;
border
:
1px
solid
#EFEFEF
;
text-align
:
center
;
color
:
rgba
(
35
,
35
,
35
,
0
.40
);
font-size
:
14px
;
cursor
:
pointer
;
line-height
:
48px
;
}
}
.el-login-footer
{
height
:
40px
;
...
...
@@ -457,6 +533,7 @@
letter-spacing
:
1px
;
}
.login-code-img
{
width
:
116px
;
height
:
48px
;
}
.enterpriselist
{
...
...
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