Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mes-ui
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
周远喜
mes-ui
Commits
db58c5a2
Commit
db58c5a2
authored
Nov 19, 2020
by
renjintao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tenantcode
parent
c55e3eaf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
247 additions
and
232 deletions
+247
-232
index.vue
pages/account/login/index.vue
+247
-232
No files found.
pages/account/login/index.vue
View file @
db58c5a2
<
template
>
<div
class=
"account"
>
<div
class=
"account"
>
<!--
<Carousel
v-model=
"value1"
autoplay
:autoplay-speed=
"5000"
loop
class=
"zmd"
>
<CarouselItem>
<div
class=
"bg bg1"
></div>
...
...
@@ -12,133 +12,148 @@
</CarouselItem>
</Carousel>
-->
<div
class=
"main"
>
<div
class=
"ad"
>
<div
class=
"page_log"
>
<img
class=
"img"
src=
"@/assets/images/login/jz_logo.png"
alt=
"logo"
/>
</div>
<img
src=
"@/assets/images/login/ivew01.png"
alt=
""
/>
<div
class=
"ad"
>
<div
class=
"page_log"
>
<img
class=
"img"
src=
"@/assets/images/login/jz_logo.png"
alt=
"logo"
/>
</div>
<div
class=
"login"
>
<div
class=
"cen"
>
<div
class=
"log_code_box"
>
<div
class=
"log_code"
@
click=
"handlTrance"
>
<img
src=
"@/assets/images/login/erwei.jpg"
alt=
"logoCode"
/>
<transition
name=
"animation"
>
<div
v-if=
"imgFlag"
class=
"sanjiao"
></div>
<!--
<img
v-if=
"imgFlag"
src=
"@/assets/images/login/sanjiao.png"
alt=
""
class=
"sanjiao"
/>
-->
</transition>
</div>
</div>
<h2
class=
"mb20"
>
登 录
</h2>
<Login
@
on-submit=
"handleSubmit"
class=
"form_sub"
>
<div
class=
"mb20"
style=
"height:40px;"
>
<Input
v-model=
"tenantCode"
size=
"large"
>
<span
slot=
"prepend"
>
租户号
</span>
</Input>
</div>
<UserName
name=
"username"
class=
"user_name"
value=
""
/>
<Password
name=
"password"
class=
"pass_word"
value=
""
enter-to-submit
/>
<div
class=
"sub_btn"
>
<Submit
class=
"shadown"
>
{{
$t
(
'page.login.submit'
)
}}
</Submit>
</div>
</Login>
<img
src=
"@/assets/images/login/ivew01.png"
alt=
""
/>
</div>
<div
class=
"login"
>
<div
class=
"cen"
>
<div
class=
"log_code_box"
>
<div
class=
"log_code"
@
click=
"handlTrance"
>
<img
src=
"@/assets/images/login/erwei.jpg"
alt=
"logoCode"
/>
<transition
name=
"animation"
>
<div
v-if=
"imgFlag"
class=
"sanjiao"
></div>
<!--
<img
v-if=
"imgFlag"
src=
"@/assets/images/login/sanjiao.png"
alt=
""
class=
"sanjiao"
/>
-->
</transition>
</div>
</div>
<h2
class=
"mb20"
>
登 录
</h2>
<Login
@
on-submit=
"handleSubmit"
class=
"form_sub"
>
<div
class=
"mb20"
style=
"height: 40px"
>
<Input
ref=
"iTenantCode"
v-model=
"tenantCode"
size=
"large"
>
<span
slot=
"prepend"
>
租户号
</span>
</Input>
</div>
<UserName
name=
"username"
class=
"user_name"
value=
""
/>
<Password
name=
"password"
class=
"pass_word"
value=
""
enter-to-submit
/>
<div
class=
"sub_btn"
>
<Submit
class=
"shadown"
>
{{
$t
(
"page.login.submit"
)
}}
</Submit>
</div>
</Login>
</div>
</div>
</div>
</div>
</div>
</
template
>
<
script
>
import
iCopyright
from
"@/components/copyright"
;
import
{
mapActions
}
from
"vuex"
;
import
{
mapActions
}
from
"vuex"
;
import
mixins
from
"../mixins"
;
import
Oidc
from
"oidc-client"
;
import
util
from
"@/libs/util"
;
var
mgr
=
new
Oidc
.
UserManager
(
window
.
authConfig
);
export
default
{
layout
:
"empty"
,
mixins
:
[
mixins
],
components
:
{
iCopyright
layout
:
"empty"
,
mixins
:
[
mixins
],
components
:
{
iCopyright
,
},
data
()
{
return
{
value1
:
0
,
autoLogin
:
true
,
imgFlag
:
true
,
//tenantCode: '000001'
tenantCode
:
""
,
};
},
created
()
{
// this.oidc();
},
mounted
()
{
this
.
$nextTick
((
x
)
=>
{
//正确写法
this
.
$refs
.
iTenantCode
.
focus
();
});
},
methods
:
{
...
mapActions
(
"admin/account"
,
[
"login"
]),
/**
* @description 登录
* 表单校验已有 iView Pro 自动完成,如有需要修改,请阅读 iView Pro 文档
*/
handleSubmit
(
valid
,
values
)
{
if
(
this
.
tenantCode
==
""
)
{
this
.
$Message
.
error
(
"租户号不能为空"
);
this
.
$nextTick
((
x
)
=>
{
//正确写法
this
.
$refs
.
iTenantCode
.
focus
();
});
return
;
}
if
(
valid
)
{
values
.
tenantcode
=
this
.
tenantCode
;
const
{
username
,
password
,
tenantcode
}
=
values
;
this
.
login
({
username
,
password
,
tenantcode
,
})
.
then
((
r
)
=>
{
if
(
r
>
0
)
{
this
.
$Message
.
success
(
"登录成功!"
);
this
.
initUserInfo
(
r
);
}
else
{
this
.
$Message
.
error
(
"登录失败!"
);
}
})
.
catch
((
e
)
=>
{
// this.$Message.error(e.message)
});
}
},
data
()
{
return
{
value1
:
0
,
autoLogin
:
true
,
imgFlag
:
true
,
tenantCode
:
'000001'
};
initUserInfo
(
id
)
{
let
parma
=
{
Id
:
id
,
};
this
.
$http
.
sysUser
.
getuserinfo
(
parma
).
then
((
res
)
=>
{
if
(
res
.
result
)
{
if
(
res
.
result
.
avatarUrl
&&
res
.
result
.
avatarUrl
!=
""
&&
res
.
result
.
avatarUrl
!=
null
)
{
res
.
result
.
avatarUrl
=
fileUrlDown
+
res
.
result
.
avatarUrl
;
}
let
info
=
res
.
result
;
info
.
auth
=
[
"admin"
];
info
.
avatar
=
info
.
avatarUrl
;
info
.
userId
=
info
.
id
;
info
.
name
=
info
.
userName
;
this
.
$store
.
dispatch
(
"admin/user/set"
,
info
,
{
root
:
true
,
});
// setUserInfo
this
.
$store
.
commit
(
"setUserInfo"
,
info
);
this
.
$router
.
replace
(
"/welcome"
);
// this.$router.replace(this.$route.query.redirect || "/");
}
else
{
this
.
$Message
.
error
(
"用户信息22查询失败!"
);
}
});
},
created
()
{
// this.oidc()
;
handlTrance
()
{
this
.
imgFlag
=
!
this
.
imgFlag
;
},
methods
:
{
...
mapActions
(
"admin/account"
,
[
"login"
]),
/**
* @description 登录
* 表单校验已有 iView Pro 自动完成,如有需要修改,请阅读 iView Pro 文档
*/
handleSubmit
(
valid
,
values
)
{
if
(
valid
)
{
values
.
tenantcode
=
this
.
tenantCode
const
{
username
,
password
,
tenantcode
}
=
values
;
this
.
login
({
username
,
password
,
tenantcode
}).
then
(
r
=>
{
if
(
r
>
0
)
{
this
.
$Message
.
success
(
"登录成功!"
);
this
.
initUserInfo
(
r
);
}
else
{
this
.
$Message
.
error
(
"登录失败!"
);
}
}).
catch
(
e
=>
{
console
.
log
(
e
)
// this.$Message.error(e.message)
});
}
},
initUserInfo
(
id
)
{
let
parma
=
{
Id
:
id
};
this
.
$http
.
sysUser
.
getuserinfo
(
parma
).
then
(
res
=>
{
if
(
res
.
result
)
{
if
(
res
.
result
.
avatarUrl
&&
res
.
result
.
avatarUrl
!=
""
&&
res
.
result
.
avatarUrl
!=
null
)
{
res
.
result
.
avatarUrl
=
fileUrlDown
+
res
.
result
.
avatarUrl
;
}
let
info
=
res
.
result
;
info
.
auth
=
[
"admin"
];
info
.
avatar
=
info
.
avatarUrl
;
info
.
userId
=
info
.
id
;
info
.
name
=
info
.
userName
;
this
.
$store
.
dispatch
(
"admin/user/set"
,
info
,
{
root
:
true
});
// setUserInfo
this
.
$store
.
commit
(
"setUserInfo"
,
info
);
this
.
$router
.
replace
(
'/welcome'
)
// this.$router.replace(this.$route.query.redirect || "/");
}
else
{
this
.
$Message
.
error
(
"用户信息22查询失败!"
);
}
});
},
handlTrance
()
{
this
.
imgFlag
=
!
this
.
imgFlag
}
}
},
};
</
script
>
...
...
@@ -146,157 +161,157 @@ export default {
@jianju: 40px;
.account {
width: 100%;
height: 100vh;
position: absolute;
// top: 0;
// bottom: 0;
background-image: url("../../../assets/images/login/login01.png");
.zmd {
z-index: 1;
position: absolute;
top: 0;
bottom: 0;
width: 100%;
}
.bg {
width: 100%;
height: 100vh;
position: absolute;
// top: 0;
// bottom: 0;
background-image: url("../../../assets/images/login/login01.png");
background-size: 100% auto;
}
.zmd {
z-index: 1;
position: absolute;
top: 0;
bottom: 0;
width: 100%;
}
.bg0 {
background-image: url("../../../assets/images/login/login01.png");
}
.bg {
width: 100%;
height: 100vh;
background-size: 100% auto;
}
.bg1 {
background-image: url("../../../assets/images/login/login01.png");
}
.bg0
{
background-image: url("../../../assets/images/login/login01.png");
}
.bg2
{
background-image: url("../../../assets/images/login/login01.png");
}
.bg1
{
background-image: url("../../../assets/images/login/login01.png");
}
.bg3
{
background-image: url("../../../assets/images/login/login01.png");
}
.bg2 {
background-image: url("../../../assets/images/login/login01.png");
}
.main {
z-index: 55;
height: 603px;
width: 1210px;
min-height: 500px;
min-width: 1100px;
margin: 140px auto;
// position: absolute;
// top: 168px;
// bottom: 168px;
// left: 360px;
// right: 360px;
background: url("../../../assets/images/login/login02.jpg") no-repeat -70px 0px;
background-size: 80%;
display: flex;
.bg3
{
background-image: url("../../../assets/images/login/login01.png")
;
h2
{
padding: 4px 0 15px 0
;
}
.main {
z-index: 55;
height: 603px;
width: 1210px;
min-height: 500px;
min-width: 1100px;
margin: 140px auto;
// position: absolute;
// top: 168px;
// bottom: 168px;
// left: 360px;
// right: 360px;
background: url("../../../assets/images/login/login02.jpg") no-repeat -70px 0px;
background-size: 80%;
display: flex;
.ad {
flex: 1;
text-align: center;
h2 {
padding: 4px 0 15px 0;
}
.ad {
flex: 1;
text-align: center;
.page_log {
display: block;
width: 304px;
height: 72px;
}
.page_log {
display: block;
width: 304px;
height: 72px;
}
.img {
margin-top: 30px;
}
.img {
margin-top: 30px;
}
img {
margin-top: 23%;
}
}
img {
margin-top: 23%;
}
}
.login {
background-color: white;
width: 410px;
padding: 0 40px;
display: flex;
// align-items: center;
flex-direction: row;
.login {
background-color: white;
width: 410px;
padding: 0 40px;
display: flex;
// align-items: center;
flex-direction: row;
.cen {
width: 100%;
.cen {
width: 100%;
.log_code_box {
text-align: right;
height: 110px;
margin: 0 -40px 0 0;
.log_code_box {
text-align: right;
height: 110px;
margin: 0 -40px 0 0;
.log_code {
position: relative;
cursor: pointer;
width: 90px;
height: 85PX
;
float: right;
.log_code {
position: relative;
cursor: pointer;
width: 90px;
height: 85px
;
float: right;
.sanjiao {
width: 90px;
height: 90px;
border-bottom: 90px solid #ffffff;
border-right: 90px solid transparent;
position: absolute;
right: 0px;
top: 0px;
}
}
}
.sanjiao {
width: 90px;
height: 90px;
border-bottom: 90px solid #ffffff;
border-right: 90px solid transparent;
position: absolute;
right: 0px;
top: 0px;
}
}
}
.ivu-input-wrapper {
margin-bottom: 6px;
}
.ivu-input-wrapper {
margin-bottom: 6px;
}
.sub_btn {
.shadown {
padding: 30px 0 0 0;
.sub_btn {
.shadown {
padding: 30px 0 0 0;
button {
height: 50px;
border-radius: 25px;
box-shadow: 0px 9px 11px 3px #c2d6ec;
letter-spacing: 3px;
font-size: 18px;
outline: none;
// background: url("../../../assets/images/login/btn_bg.png") no-repeat center;
// span{
// margin: -14px 0 0;
// display: block;
// }
}
}
}
button {
height: 50px;
border-radius: 25px;
box-shadow: 0px 9px 11px 3px #c2d6ec;
letter-spacing: 3px;
font-size: 18px;
outline: none;
// background: url("../../../assets/images/login/btn_bg.png") no-repeat center;
// span{
// margin: -14px 0 0;
// display: block;
// }
}
}
}
}
}
}
}
.animation-enter-to,
.animation-leave-to {
animation: mymove 1s 1s linear;
animation: mymove 1s 1s linear;
}
@keyframes mymove {
0% {
transform: translateX(0px);
}
0% {
transform: translateX(0px);
}
100% {
transform: translateX(-45px);
}
100% {
transform: translateX(-45px);
}
}
</
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