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
Show 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
>
<div
class=
"account"
>
<div
class=
"account"
>
<vue-particles
color=
"#dedede"
></vue-particles>
<div
class=
"login"
>
<div
class=
"page-account-top"
>
...
...
@@ -10,6 +10,11 @@
</div>
<h3
class=
"mb20"
>
用户登陆
</h3>
<Login
@
on-submit=
"handleSubmit"
>
<div
class=
""
style=
"height:40px;margin-bottom:15px;"
>
<Input
v-model=
"tenantCode"
size=
"large"
>
<span
slot=
"prepend"
>
租户号
</span>
</Input>
</div>
<UserName
name=
"username"
value=
"13211111111"
/>
<Password
name=
"password"
value=
"1"
enter-to-submit
/>
<div
class=
"page-account-auto-login mb20"
>
...
...
@@ -21,11 +26,14 @@
</div>
</Login>
</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"
;
...
...
@@ -33,14 +41,17 @@ var mgr = new Oidc.UserManager(window.authConfig);
export
default
{
layout
:
"empty"
,
mixins
:
[
mixins
],
components
:
{
iCopyright
},
components
:
{
iCopyright
},
data
()
{
return
{
value1
:
0
,
autoLogin
:
true
autoLogin
:
true
,
tenantCode
:
'000001'
};
},
head
()
{
head
()
{
return
{
title
:
'SaaS MES 制造执行---系统管理'
,
meta
:
[{
...
...
@@ -61,10 +72,17 @@ export default {
*/
handleSubmit
(
valid
,
values
)
{
if
(
valid
)
{
const
{
username
,
password
}
=
values
;
values
.
tenantcode
=
this
.
tenantCode
alert
(
JSON
.
stringify
(
values
))
const
{
username
,
password
,
tenantcode
}
=
values
;
this
.
login
({
username
,
password
password
,
tenantcode
}).
then
(
r
=>
{
if
(
r
>
0
)
{
this
.
$Message
.
success
(
"登陆成功!"
);
...
...
@@ -89,7 +107,7 @@ export default {
res
.
result
.
avatarUrl
=
fileUrlDown
+
res
.
result
.
avatarUrl
;
}
let
info
=
res
.
result
;
info
.
tenantCode
=
info
.
tenantCode
=
info
.
auth
=
[
"admin"
];
info
.
avatar
=
info
.
avatarUrl
;
info
.
userId
=
info
.
id
;
...
...
@@ -108,8 +126,10 @@ export default {
}
};
</
script
>
<
style
lang=
"less"
>
@jianju: 40px;
.account {
position: fixed;
width: 100%;
...
...
@@ -117,12 +137,14 @@ export default {
bottom: 0;
background-image: url("../../../assets/images/login/login_bg.jpg");
background-size: cover;
#particles-js{
#particles-js {
z-index: 2;
position: absolute;
width: 100%;
height: 100vh;
}
.login {
position: absolute;
z-index: 99;
...
...
@@ -132,15 +154,18 @@ export default {
padding: 20px 50px;
border-radius: 10px;
left: 50%;
top:
50%;
top:
50%;
color: #ddd;
transform: translate(-50%,
-50%);
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;
}
...
...
store/admin/account.js
View file @
98cb6ba5
...
...
@@ -22,13 +22,15 @@ export const actions = {
dispatch
},
{
username
=
''
,
password
=
''
password
=
''
,
tenantcode
=
''
}
=
{})
{
return
new
Promise
((
resolve
,
reject
)
=>
{
// 开始请求登录接口
AccountLogin
({
username
,
password
password
,
tenantcode
})
.
then
(
async
res
=>
{
// 设置 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