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
Show 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>
...
...
@@ -31,28 +31,31 @@
</div>
<h2
class=
"mb20"
>
登 录
</h2>
<Login
@
on-submit=
"handleSubmit"
class=
"form_sub"
>
<div
class=
"mb20"
style=
"height:40px;
"
>
<Input
v-model=
"tenantCode"
size=
"large"
>
<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
/>
<Password
name=
"password"
class=
"pass_word"
value=
""
enter-to-submit
/>
<div
class=
"sub_btn"
>
<Submit
class=
"shadown"
>
{{
$t
(
'page.login.submit'
)
}}
</Submit>
<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"
;
...
...
@@ -61,19 +64,26 @@ export default {
layout
:
"empty"
,
mixins
:
[
mixins
],
components
:
{
iCopyright
iCopyright
,
},
data
()
{
return
{
value1
:
0
,
autoLogin
:
true
,
imgFlag
:
true
,
tenantCode
:
'000001'
//tenantCode: '000001'
tenantCode
:
""
,
};
},
created
()
{
// this.oidc();
},
mounted
()
{
this
.
$nextTick
((
x
)
=>
{
//正确写法
this
.
$refs
.
iTenantCode
.
focus
();
});
},
methods
:
{
...
mapActions
(
"admin/account"
,
[
"login"
]),
/**
...
...
@@ -81,35 +91,40 @@ export default {
* 表单校验已有 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
;
values
.
tenantcode
=
this
.
tenantCode
;
const
{
username
,
password
,
tenantcode
}
=
values
;
this
.
login
({
username
,
password
,
tenantcode
}).
then
(
r
=>
{
tenantcode
,
})
.
then
((
r
)
=>
{
if
(
r
>
0
)
{
this
.
$Message
.
success
(
"登录成功!"
);
this
.
initUserInfo
(
r
);
}
else
{
this
.
$Message
.
error
(
"登录失败!"
);
}
}).
catch
(
e
=>
{
console
.
log
(
e
)
})
.
catch
((
e
)
=>
{
// this.$Message.error(e.message)
});
}
},
initUserInfo
(
id
)
{
let
parma
=
{
Id
:
id
Id
:
id
,
};
this
.
$http
.
sysUser
.
getuserinfo
(
parma
).
then
(
res
=>
{
this
.
$http
.
sysUser
.
getuserinfo
(
parma
).
then
((
res
)
=>
{
if
(
res
.
result
)
{
if
(
res
.
result
.
avatarUrl
&&
...
...
@@ -124,11 +139,11 @@ export default {
info
.
userId
=
info
.
id
;
info
.
name
=
info
.
userName
;
this
.
$store
.
dispatch
(
"admin/user/set"
,
info
,
{
root
:
true
root
:
true
,
});
// setUserInfo
this
.
$store
.
commit
(
"setUserInfo"
,
info
);
this
.
$router
.
replace
(
'/welcome'
)
this
.
$router
.
replace
(
"/welcome"
);
// this.$router.replace(this.$route.query.redirect || "/");
}
else
{
this
.
$Message
.
error
(
"用户信息22查询失败!"
);
...
...
@@ -136,9 +151,9 @@ export default {
});
},
handlTrance
()
{
this
.
imgFlag
=
!
this
.
imgFlag
}
}
this
.
imgFlag
=
!
this
.
imgFlag
;
},
},
};
</
script
>
...
...
@@ -242,7 +257,7 @@ export default {
position: relative;
cursor: pointer;
width: 90px;
height: 85PX
;
height: 85px
;
float: right;
.sanjiao {
...
...
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