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
98cb6ba5
Commit
98cb6ba5
authored
Sep 22, 2020
by
renjintao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
login tenantcode
parent
d87fcd76
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
155 additions
and
128 deletions
+155
-128
index.vue
pages/account/login/index.vue
+151
-126
account.js
store/admin/account.js
+4
-2
No files found.
pages/account/login/index.vue
View file @
98cb6ba5
<
template
>
<
template
>
<div
class=
"account"
>
<div
class=
"account"
>
<vue-particles
color=
"#dedede"
></vue-particles>
<vue-particles
color=
"#dedede"
></vue-particles>
<div
class=
"login"
>
<div
class=
"login"
>
<div
class=
"page-account-top"
>
<div
class=
"page-account-top"
>
<div
class=
"page-account-top-logo tc"
>
<div
class=
"page-account-top-logo tc"
>
<img
src=
"@/assets/images/logo.png"
alt=
"logo"
/>
<img
src=
"@/assets/images/logo.png"
alt=
"logo"
/>
</div>
<div
class=
"tc"
>
SaaS MES 制造执行---系统管理
</div>
</div>
</div>
<div
class=
"tc"
>
SaaS MES 制造执行---系统管理
</div>
<h3
class=
"mb20"
>
用户登陆
</h3>
</div>
<Login
@
on-submit=
"handleSubmit"
>
<h3
class=
"mb20"
>
用户登陆
</h3>
<div
class=
""
style=
"height:40px;margin-bottom:15px;"
>
<Login
@
on-submit=
"handleSubmit"
>
<Input
v-model=
"tenantCode"
size=
"large"
>
<UserName
name=
"username"
value=
"13211111111"
/>
<span
slot=
"prepend"
>
租户号
</span>
<Password
name=
"password"
value=
"1"
enter-to-submit
/>
</Input>
<div
class=
"page-account-auto-login mb20"
>
</div>
<Checkbox
v-model=
"autoLogin"
>
{{
$t
(
'page.login.remember'
)
}}
</Checkbox>
<UserName
name=
"username"
value=
"13211111111"
/>
<a
href
>
{{
$t
(
'page.login.forgot'
)
}}
</a>
<Password
name=
"password"
value=
"1"
enter-to-submit
/>
</div>
<div
class=
"page-account-auto-login mb20"
>
<div
class=
"mt20"
>
<Checkbox
v-model=
"autoLogin"
>
{{
$t
(
'page.login.remember'
)
}}
</Checkbox>
<Submit
class=
"shadown"
>
{{
$t
(
'page.login.submit'
)
}}
</Submit>
<a
href
>
{{
$t
(
'page.login.forgot'
)
}}
</a>
</div>
</div>
</Login>
<div
class=
"mt20"
>
<Submit
class=
"shadown"
>
{{
$t
(
'page.login.submit'
)
}}
</Submit>
</div>
</Login>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
iCopyright
from
"@/components/copyright"
;
import
iCopyright
from
"@/components/copyright"
;
import
{
mapActions
}
from
"vuex"
;
import
{
mapActions
}
from
"vuex"
;
import
mixins
from
"../mixins"
;
import
mixins
from
"../mixins"
;
import
Oidc
from
"oidc-client"
;
import
Oidc
from
"oidc-client"
;
import
util
from
"@/libs/util"
;
import
util
from
"@/libs/util"
;
var
mgr
=
new
Oidc
.
UserManager
(
window
.
authConfig
);
var
mgr
=
new
Oidc
.
UserManager
(
window
.
authConfig
);
export
default
{
export
default
{
layout
:
"empty"
,
layout
:
"empty"
,
mixins
:
[
mixins
],
mixins
:
[
mixins
],
components
:
{
iCopyright
},
components
:
{
data
()
{
iCopyright
return
{
value1
:
0
,
autoLogin
:
true
};
},
head
(){
return
{
title
:
'SaaS MES 制造执行---系统管理'
,
meta
:
[{
hid
:
"description"
,
name
:
"description"
,
content
:
"funny jokes page"
}]
}
},
created
()
{
// this.oidc();
},
methods
:
{
...
mapActions
(
"admin/account"
,
[
"login"
]),
/**
* @description 登录
* 表单校验已有 iView Pro 自动完成,如有需要修改,请阅读 iView Pro 文档
*/
handleSubmit
(
valid
,
values
)
{
if
(
valid
)
{
const
{
username
,
password
}
=
values
;
this
.
login
({
username
,
password
}).
then
(
r
=>
{
if
(
r
>
0
)
{
this
.
$Message
.
success
(
"登陆成功!"
);
this
.
initUserInfo
(
r
);
}
else
{
this
.
$Message
.
error
(
"登陆失败!"
);
}
});
}
},
},
initUserInfo
(
id
)
{
data
()
{
let
parma
=
{
return
{
Id
:
id
value1
:
0
,
};
autoLogin
:
true
,
this
.
$http
.
sysUser
.
getuserinfo
(
parma
).
then
(
res
=>
{
tenantCode
:
'000001'
if
(
res
.
result
)
{
};
if
(
},
res
.
result
.
avatarUrl
&&
head
()
{
res
.
result
.
avatarUrl
!=
""
&&
return
{
res
.
result
.
avatarUrl
!=
null
title
:
'SaaS MES 制造执行---系统管理'
,
)
{
meta
:
[{
res
.
result
.
avatarUrl
=
fileUrlDown
+
res
.
result
.
avatarUrl
;
hid
:
"description"
,
}
name
:
"description"
,
let
info
=
res
.
result
;
content
:
"funny jokes page"
info
.
tenantCode
=
}]
info
.
auth
=
[
"admin"
];
}
info
.
avatar
=
info
.
avatarUrl
;
},
info
.
userId
=
info
.
id
;
created
()
{
info
.
name
=
info
.
userName
;
// this.oidc();
this
.
$store
.
dispatch
(
"admin/user/set"
,
info
,
{
},
root
:
true
methods
:
{
});
...
mapActions
(
"admin/account"
,
[
"login"
]),
// setUserInfo
/**
this
.
$store
.
commit
(
"setUserInfo"
,
info
);
* @description 登录
this
.
$router
.
replace
(
this
.
$route
.
query
.
redirect
||
"/"
);
* 表单校验已有 iView Pro 自动完成,如有需要修改,请阅读 iView Pro 文档
}
else
{
*/
this
.
$Message
.
error
(
"用户信息22查询失败!"
);
handleSubmit
(
valid
,
values
)
{
if
(
valid
)
{
values
.
tenantcode
=
this
.
tenantCode
alert
(
JSON
.
stringify
(
values
))
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
(
"登陆失败!"
);
}
});
}
},
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
.
tenantCode
=
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
(
this
.
$route
.
query
.
redirect
||
"/"
);
}
else
{
this
.
$Message
.
error
(
"用户信息22查询失败!"
);
}
});
}
}
});
}
}
}
};
};
</
script
>
</
script
>
<
style
lang=
"less"
>
<
style
lang=
"less"
>
@jianju: 40px;
@jianju: 40px;
.account {
.account {
position: fixed;
position: fixed;
width: 100%;
top: 0;
bottom: 0;
background-image: url("../../../assets/images/login/login_bg.jpg");
background-size: cover;
#particles-js{
z-index: 2;
position: absolute;
width: 100%;
width: 100%;
height: 100vh;
top: 0;
}
bottom: 0;
.login {
background-image: url("../../../assets/images/login/login_bg.jpg");
position: absolute;
background-size: cover;
z-index: 99;
background-color: #214f5f;
#particles-js {
width: 500px;
z-index: 2;
height: 540px;
position: absolute;
padding: 20px 50px;
width: 100%;
border-radius: 10px;
height: 100vh;
left: 50%;
}
top:50%;
color: #ddd;
.login {
transform: translate(-50%,-50%);
position: absolute;
box-shadow: 1px 15px 35px #022d36;
z-index: 99;
.mt20 {
background-color: #214f5f;
margin-top: 50px;
width: 500px;
.shadown {
height: 540px;
box-shadow: 1px -5px -15px #2680eb;
padding: 20px 50px;
}
border-radius: 10px;
.ivu-btn-large {
left: 50%;
height: 50px !important;
top: 50%;
}
color: #ddd;
transform: translate(-50%, -50%);
box-shadow: 1px 15px 35px #022d36;
.mt20 {
margin-top: 50px;
.shadown {
box-shadow: 1px -5px -15px #2680eb;
}
.ivu-btn-large {
height: 50px !important;
}
}
}
}
}
}
}
</
style
>
</
style
>
\ No newline at end of file
store/admin/account.js
View file @
98cb6ba5
...
@@ -22,13 +22,15 @@ export const actions = {
...
@@ -22,13 +22,15 @@ export const actions = {
dispatch
dispatch
},
{
},
{
username
=
''
,
username
=
''
,
password
=
''
password
=
''
,
tenantcode
=
''
}
=
{})
{
}
=
{})
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
// 开始请求登录接口
// 开始请求登录接口
AccountLogin
({
AccountLogin
({
username
,
username
,
password
password
,
tenantcode
})
})
.
then
(
async
res
=>
{
.
then
(
async
res
=>
{
// 设置 cookie 一定要存 uuid 和 token 两个 cookie
// 设置 cookie 一定要存 uuid 和 token 两个 cookie
...
...
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