Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
folacin-front
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
ynby
folacin-front
Commits
2dbb99a8
Commit
2dbb99a8
authored
Jul 22, 2021
by
罗成兵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分配记录
parent
5c18c61b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
169 additions
and
10 deletions
+169
-10
Home_dev.vue
src/views/Home_dev.vue
+161
-0
Login.vue
src/views/Login.vue
+8
-10
No files found.
src/views/Home_dev.vue
0 → 100644
View file @
2dbb99a8
<
template
>
<a-layout
class=
"home_layout index_body"
style=
"width: 100%"
>
<a-layout>
<a-layout-content
class=
"layout_container"
style=
"background: #fff"
>
<div
style=
"padding: 24px;"
>
<a-tabs
type=
"card"
:tabBarGutter=
"10"
v-model=
"$store.state.activeKeyInfo"
@
change=
"onChange"
>
<a-tab-pane
v-for=
"(item, index) in menuList"
:key=
"item.frontActionUrl"
>
<span
slot=
"tab"
>
<!--
<span
v-if=
"item.frontActionUrl != '/Home/distributionWarehousing' && item.frontActionUrl != '/Home/folviteApply'"
--
>
<!-- >
{{
item
.
name
}}
</span>
-->
<!--
<span
v-else
>
-->
<span>
{{
item
.
name
}}
<span>
(0)
</span></span>
<!--
<span
v-if=
"item.frontActionUrl == '/Home/distributionWarehousing'"
>
{{
item
.
name
}}
<span>
(0)
</span></span>
-->
<!--
<span
v-if=
"item.frontActionUrl == '/Home/folviteApply'"
>
{{
item
.
name
}}
<span>
(0)
</span></span>
-->
</span>
<span>
{{
item
.
name
}}
</span>
</span>
</a-tab-pane>
</a-tabs>
<router-view></router-view>
</div>
</a-layout-content>
<div
style=
"clear: both"
></div>
</a-layout>
</a-layout>
</
template
>
<
script
>
import
{
getCookie
}
from
"./utils/common"
;
import
{
menuTest
}
from
"./utils/testDate"
;
const
unitTabs
=
[
{
name
:
'在库管理'
,
key
:
'/Home/inStock'
,
path
:
'/Home/inStock'
,
parent
:
null
,
}
]
export
default
{
data
()
{
return
{
// 菜单
menuList
:
[],
// 选中的菜单
activeItem
:
[],
// tabs标签
tabs
:
[],
// 选中的tabs标签
activeKey
:
''
,
showChildren
:
false
,
menuTest
,
}
},
created
()
{
document
.
cookie
=
'bGNnd3lwdF9hdA='
+
sessionStorage
.
getItem
(
"token"
)
+
';'
//云南省
let
cookieToken
=
getCookie
(
'bGNnd3lwdF9hdA'
);
cookieToken
=
sessionStorage
.
getItem
(
"token"
);
console
.
log
(
'tokenInfo'
,
cookieToken
)
this
.
menuList
=
menuTest
;
if
(
cookieToken
)
{
let
par
=
{}
this
.
$api
.
fyManage
.
fetchFYLoginUser
(
par
).
then
(({
data
})
=>
{
window
.
sessionStorage
.
setItem
(
'menuList'
,
JSON
.
stringify
(
this
.
menuList
));
window
.
sessionStorage
.
setItem
(
'userInfo'
,
JSON
.
stringify
(
data
.
userInfo
));
window
.
sessionStorage
.
setItem
(
'allEnum'
,
JSON
.
stringify
(
data
.
enumValueList
))
this
.
setInitMenuInfo
()
this
.
showChildren
=
true
})
}
else
{
console
.
log
(
'没有token11'
)
window
.
top
.
postMessage
({
messageType
:
"LOGOUT"
},
'*'
)
//给最顶层窗口发送token失效通知
return
}
},
methods
:
{
setInitMenuInfo
()
{
//设置默认菜单和菜单缓存
this
.
menuList
=
menuTest
;
console
.
log
(
this
.
menuList
)
this
.
menuList
=
this
.
menuTest
if
(
!
window
.
sessionStorage
.
getItem
(
"tabs"
))
{
window
.
sessionStorage
.
setItem
(
'tabs'
,
JSON
.
stringify
(
this
.
menuTest
));
this
.
$store
.
commit
(
'changeTabs'
,
this
.
menuTest
)
this
.
tabs
=
this
.
$store
.
state
.
tabsInfo
}
if
(
!
window
.
sessionStorage
.
getItem
(
'activeItem'
))
{
window
.
sessionStorage
.
setItem
(
'activeItem'
,
'/Home/inStock'
)
}
// if (!window.sessionStorage.getItem('activeKey')) {
// let nowUrl = window.location.href;
// this.$router.push({path: nowUrl, query: {}})
// this.$store.commit('changeActKey', '/Home/inStock')
// }
const
tabs
=
JSON
.
parse
(
window
.
sessionStorage
.
getItem
(
'tabs'
));
if
(
tabs
)
{
this
.
tabs
=
tabs
;
this
.
$store
.
commit
(
'changeTabs'
,
tabs
)
}
const
activeKey
=
window
.
sessionStorage
.
getItem
(
'activeItem'
);
if
(
activeKey
)
{
this
.
activeKey
=
activeKey
;
this
.
$store
.
commit
(
'changeActKey'
,
activeKey
)
}
},
// 点击tabs标签
onChange
(
activeKey
)
{
this
.
activeKey
=
activeKey
;
window
.
sessionStorage
.
setItem
(
'activeKey'
,
this
.
activeKey
);
this
.
$store
.
commit
(
'changeActKey'
,
this
.
activeKey
)
this
.
$store
.
state
.
tabsInfo
.
forEach
((
item
,
i
)
=>
{
if
(
item
.
frontActionUrl
===
activeKey
)
{
this
.
activeItem
=
[
item
.
frontActionUrl
];
window
.
sessionStorage
.
setItem
(
'activeItem'
,
this
.
activeItem
);
this
.
$router
.
push
(
item
.
frontActionUrl
);
}
});
},
},
}
</
script
>
<
style
lang=
"less"
>
.index_body {
.ant-tabs-bar {
border-bottom: 1px solid rgba(255, 77, 128, .2) !important;
}
.ant-tabs-nav-scroll {
margin-left: 0px !important;
}
.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-nav-container {
height: 35px !important;
}
.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab {
height: 35px !important;
color: #F8F8FF !important;
line-height: 35px !important;
background: rgba(255, 77, 128, .5);
border-bottom: 0px solid #FF4D80;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
}
.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab-active {
height: 35px !important;
color: #fff;
background: #FF4D80;
border-color: #FF4D80;
border-bottom: 0px solid #FF4D80;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
}
}
</
style
>
src/views/Login.vue
View file @
2dbb99a8
<!--
<
template
>
<
template
>
<div
class=
"login_container"
>
<div
class=
"login_container"
>
<div
class=
"login_box"
>
<div
class=
"login_box"
>
...
@@ -46,7 +45,6 @@
...
@@ -46,7 +45,6 @@
<a-button
@
click=
"login"
type=
"primary"
block
size=
"large"
:disabled=
"!captchaVerificationVis"
<a-button
@
click=
"login"
type=
"primary"
block
size=
"large"
:disabled=
"!captchaVerificationVis"
:loading=
"loading"
@
keyup
.
enter=
"login"
>
登录
:loading=
"loading"
@
keyup
.
enter=
"login"
>
登录
</a-button>
</a-button>
<
!
–
<a
href=
"javascript:;"
style=
"float: right;text-decoration: none;"
@
click=
"toNetwork"
>
网点管理登录
</a>
–>
</a-form-model>
</a-form-model>
</div>
</div>
</div>
</div>
...
@@ -54,7 +52,6 @@
...
@@ -54,7 +52,6 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
Verify
from
"@/views/components/verifition/Verify"
;
import
Verify
from
"@/views/components/verifition/Verify"
;
import
{
getEnumByFlag
}
from
"./utils/common"
;
import
{
singleLogin
,
aesEncrypt
}
from
"./utils/loginApi"
;
import
{
singleLogin
,
aesEncrypt
}
from
"./utils/loginApi"
;
export
default
{
export
default
{
...
@@ -82,23 +79,24 @@
...
@@ -82,23 +79,24 @@
},
},
methods
:
{
methods
:
{
userChange
(
value
)
{
userChange
(
value
)
{
this
.
formData
.
username
=
this
.
userList
[
value
].
userName
;
this
.
formData
.
username
=
this
.
userList
[
value
].
userName
;
this
.
formData
.
password
=
this
.
userList
[
value
].
password
;
this
.
formData
.
password
=
this
.
userList
[
value
].
password
;
},
},
login
()
{
login
()
{
this
.
loading
=
true
;
this
.
loading
=
true
;
let
fromData
=
new
FormData
();
let
fromData
=
new
FormData
();
fromData
.
append
(
"username"
,
aesEncrypt
(
"9028584165"
));
// fromData.append("username", aesEncrypt("9028584165"));
fromData
.
append
(
"password"
,
aesEncrypt
(
"074332"
));
// fromData.append("password", aesEncrypt("074332"));
fromData
.
append
(
"username"
,
aesEncrypt
(
this
.
formData
.
username
));
fromData
.
append
(
"password"
,
aesEncrypt
(
this
.
formData
.
password
));
fromData
.
append
(
fromData
.
append
(
"captchaVerification"
,
"captchaVerification"
,
this
.
captchaVerification
.
captchaVerification
this
.
captchaVerification
.
captchaVerification
);
);
singleLogin
(
fromData
).
then
(
res
=>
{
singleLogin
(
fromData
).
then
(
res
=>
{
if
(
res
.
data
.
code
===
"SUCCESS"
)
{
if
(
res
.
data
.
code
===
"SUCCESS"
)
{
console
.
log
(
"登录成功"
,
res
.
data
.
data
);
sessionStorage
.
setItem
(
'token'
,
"bearer "
+
res
.
data
.
data
.
token
);
sessionStorage
.
setItem
(
'token'
,
'bearer'
+
' '
+
res
.
data
.
data
.
token
);
this
.
$router
.
push
(
'/Home'
);
this
.
$router
.
push
(
'/'
)
this
.
$message
.
success
(
res
.
data
.
msg
)
this
.
$message
.
success
(
res
.
data
.
msg
)
}
else
{
}
else
{
this
.
$message
.
error
(
res
.
data
.
msg
)
this
.
$message
.
error
(
res
.
data
.
msg
)
...
...
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