Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
micro-customization-system
/
micro-portal
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 23ab8dbc
authored
Jun 13, 2022
by
张晓玮
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'zxw-1.8.0' into 'v1.8.0'
Zxw 1.8.0 See merge request
!12
2 parents
895c369b
9d54a072
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
88 additions
and
50 deletions
src/App.vue
src/utils/common/common.js
src/views/Dashboard.vue
src/views/Login.vue
src/App.vue
View file @
23ab8db
...
@@ -21,7 +21,7 @@ import actions from "@/micro/app-store";
...
@@ -21,7 +21,7 @@ import actions from "@/micro/app-store";
import
{
onCreated
,
onMounted
,
computed
,
reactive
,
toRefs
}
from
'vue'
;
import
{
onCreated
,
onMounted
,
computed
,
reactive
,
toRefs
}
from
'vue'
;
import
{
useStore
}
from
'vuex'
;
import
{
useStore
}
from
'vuex'
;
import
{
Common
}
from
"@/utils/common/common"
;
export
default
{
export
default
{
name
:
"App"
,
name
:
"App"
,
...
@@ -35,11 +35,11 @@ export default {
...
@@ -35,11 +35,11 @@ export default {
let
hasToken
=
computed
(()
=>
{
let
hasToken
=
computed
(()
=>
{
let
tokenStatus
=
!!
store
.
getters
.
token
;
let
tokenStatus
=
!!
store
.
getters
.
token
;
let
flag
=
true
;
//
let flag = true;
if
(
tokenStatus
&&
flag
)
{
//
if(tokenStatus && flag) {
microAppStart
();
//
microAppStart();
flag
=
false
;
//
flag = false;
}
//
}
return
tokenStatus
;
return
tokenStatus
;
})
})
...
@@ -48,10 +48,17 @@ export default {
...
@@ -48,10 +48,17 @@ export default {
})
})
// 判断页面是否通过window.open 打开(v1.7.0版本地图页面操作是打开新窗口 将菜单栏隐藏)
// 判断页面是否通过window.open 打开(v1.7.0版本地图页面操作是打开新窗口 将菜单栏隐藏)
if
(
window
.
opener
)
{
if
(
window
.
opener
)
{
const
store
=
useStore
()
let
flag
=
true
store
.
state
.
collapsed
=
true
// 新窗口打开 非地图页面
store
.
dispatch
(
'app/setCollapsed'
,
true
)
Common
.
noHiddenMenu
.
map
(
val
=>
{
actions
.
setGlobalState
({
isCollapsed
:
true
})
if
(
window
.
location
.
hash
.
indexOf
(
val
)
>
-
1
)
flag
=
false
})
if
(
flag
)
{
const
store
=
useStore
()
store
.
state
.
collapsed
=
true
store
.
dispatch
(
'app/setCollapsed'
,
true
)
actions
.
setGlobalState
({
isCollapsed
:
true
})
}
}
}
return
{
return
{
hasToken
,
hasToken
,
...
...
src/utils/common/common.js
View file @
23ab8db
...
@@ -117,7 +117,7 @@ export const Common = {
...
@@ -117,7 +117,7 @@ export const Common = {
}
else
{
}
else
{
return
true
;
return
true
;
}
}
}
}
,
// 不隐藏菜单和header的路由
noHiddenMenu
:
[
'/alarmCenter/alarmLog'
,
'/alarmCenter/alarm/detail'
,
'/alarmCenter/tamper'
]
}
}
src/views/Dashboard.vue
View file @
23ab8db
...
@@ -20,9 +20,10 @@
...
@@ -20,9 +20,10 @@
import
DesktopLeftSider
from
'components/DesktopLeftSider/DesktopLeftSider'
;
import
DesktopLeftSider
from
'components/DesktopLeftSider/DesktopLeftSider'
;
import
DesktopTopSider
from
'components/DesktopTopSider/DesktopTopSider'
;
import
DesktopTopSider
from
'components/DesktopTopSider/DesktopTopSider'
;
import
DesktopRightSider
from
'components/DesktopRightSider/DesktopRightSider'
;
import
DesktopRightSider
from
'components/DesktopRightSider/DesktopRightSider'
;
import
microAppStart
from
"../micro/auth"
import
{
reactive
,
toRefs
,
onMounted
}
from
'vue'
;
import
{
reactive
,
toRefs
,
onMounted
}
from
'vue'
;
import
{
useStore
}
from
'vuex'
;
import
{
Common
}
from
"@/utils/common/common"
;
export
default
{
export
default
{
name
:
"Desktop"
,
name
:
"Desktop"
,
components
:
{
components
:
{
...
@@ -30,26 +31,31 @@ export default {
...
@@ -30,26 +31,31 @@ export default {
DesktopTopSider
,
DesktopTopSider
,
DesktopRightSider
DesktopRightSider
},
},
data
()
{
return
{
isShowTopSider
:
true
}
},
created
()
{
if
(
window
.
opener
)
{
this
.
isShowTopSider
=
false
}
},
setup
()
{
setup
()
{
const
store
=
useStore
()
const
state
=
reactive
({
const
state
=
reactive
({
collapsed
:
false
collapsed
:
false
,
isShowTopSider
:
true
});
});
if
(
window
.
opener
)
{
let
flag
=
true
// 新窗口打开 非地图页面
Common
.
noHiddenMenu
.
map
(
val
=>
{
if
(
window
.
location
.
hash
.
indexOf
(
val
)
>
-
1
)
flag
=
false
})
if
(
flag
)
state
.
isShowTopSider
=
false
}
const
getCollapsed
=
(
data
)
=>
{
const
getCollapsed
=
(
data
)
=>
{
console
.
log
(
data
);
console
.
log
(
data
);
state
.
collapsed
=
data
;
state
.
collapsed
=
data
;
};
};
onMounted
(()
=>
{
onMounted
(()
=>
{
let
tokenStatus
=
!!
store
.
getters
.
token
;
if
(
tokenStatus
&&
!
window
.
qiankunStarted
)
{
window
.
qiankunStarted
=
true
microAppStart
();
}
});
});
return
{
return
{
...
...
src/views/Login.vue
View file @
23ab8db
...
@@ -12,28 +12,30 @@
...
@@ -12,28 +12,30 @@
<div
class=
"left"
></div>
<div
class=
"left"
></div>
<div
class=
"right"
>
<div
class=
"right"
>
<div
class=
"login_card"
>
<div
class=
"login_card"
>
<div
class=
"small_logo"
>
<div
class=
"login-content"
>
<img
class=
"home-logo-img"
:src=
"logo"
:key=
"logo"
alt=
"company-logo"
/>
<div
class=
"small_logo"
>
<img
class=
"home-logo-img"
:src=
"logo"
:key=
"logo"
alt=
"company-logo"
/>
</div>
<h1
class=
"login-title"
>
{{
title
}}
</h1>
<div
v-if=
"showAlert"
>
<el-alert
v-for=
"(item, index) in alertArr"
:key=
"index"
:title=
"item"
type=
"error"
show-icon
/>
</div>
<el-form>
<el-form-item
class=
"username-wrapper"
prop=
"name"
>
<el-input
class=
"login-input username-input"
placeholder=
"请输入用户名"
maxLength=
"50"
v-model=
"formInline.user"
>
</el-input>
</el-form-item>
<el-form-item
class=
"form-wrapper pwd-wrapper"
prop=
"pass"
>
<el-input
class=
"login-input"
placeholder=
"请输入密码"
v-model=
"formInline.password"
maxLength=
"20"
show-password
autocomplete=
"off"
>
</el-input>
</el-form-item>
<el-form-item
class=
"login-button-wrapper"
@
keyup
.
enter=
"handleSubmit"
@
click
.
native
.
prevent=
"handleSubmit"
>
<el-button
class=
"login-button"
type=
"primary"
html-type=
"submit"
>
登录
</el-button>
</el-form-item>
</el-form>
</div>
</div>
<h1
class=
"login-title"
>
{{
title
}}
</h1>
<div
v-if=
"showAlert"
>
<el-alert
v-for=
"(item, index) in alertArr"
:key=
"index"
:title=
"item"
type=
"error"
show-icon
/>
</div>
<el-form>
<el-form-item
class=
"username-wrapper"
prop=
"name"
>
<el-input
class=
"login-input username-input"
placeholder=
"请输入用户名"
maxLength=
"50"
v-model=
"formInline.user"
>
</el-input>
</el-form-item>
<el-form-item
class=
"form-wrapper pwd-wrapper"
prop=
"pass"
>
<el-input
class=
"login-input"
placeholder=
"请输入密码"
v-model=
"formInline.password"
maxLength=
"20"
show-password
autocomplete=
"off"
>
</el-input>
</el-form-item>
<el-form-item
class=
"login-button-wrapper"
@
keyup
.
enter=
"handleSubmit"
@
click
.
native
.
prevent=
"handleSubmit"
>
<el-button
class=
"login-button"
type=
"primary"
html-type=
"submit"
>
登录
</el-button>
</el-form-item>
</el-form>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -197,8 +199,14 @@ export default {
...
@@ -197,8 +199,14 @@ export default {
width
:
100%
;
width
:
100%
;
display
:
flex
;
display
:
flex
;
flex-direction
:
column
;
flex-direction
:
column
;
overflow
:
hidden
;
.login_header
{
.login_header
{
width
:
100%
;
height
:
60px
;
height
:
60px
;
.home-logo-img
{
max-width
:
100%
;
}
//
padding
:20px
;
}
}
.login_box
{
.login_box
{
width
:
100%
;
width
:
100%
;
...
@@ -214,15 +222,26 @@ export default {
...
@@ -214,15 +222,26 @@ export default {
align-items
:
center
;
align-items
:
center
;
justify-content
:
flex-end
;
justify-content
:
flex-end
;
padding
:
0
60px
0
0
;
padding
:
0
60px
0
0
;
@media
(
max-width
:
414px
)
{
padding
:
0
;
}
}
}
.login_card
{
.login_card
{
background-color
:
#fff
;
background-color
:
#fff
;
background-clip
:
border-box
;
background-clip
:
border-box
;
border-radius
:
4px
;
border-radius
:
4px
;
width
:
410px
;
width
:
410px
;
padding
:
45px
;
@media
(
max-width
:
414px
)
{
width
:
100%
;
}
padding
:
45px
0
;
box-sizing
:
border-box
;
box-sizing
:
border-box
;
.home-logo-img
{
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
.login-content
{
width
:
320px
;
.home-logo-img
{
max-width
:
100%
;
max-width
:
100%
;
height
:
50px
;
height
:
50px
;
}
}
...
@@ -245,11 +264,17 @@ export default {
...
@@ -245,11 +264,17 @@ export default {
border-color
:
transparent
;
border-color
:
transparent
;
}
}
}
}
}
}
}
}
}
.login_footer
{
.login_footer
{
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
padding
:
0
15px
;
height
:
60px
;
height
:
60px
;
line-height
:
60px
;
//
line-height
:
60px
;
font-size
:
12px
;
font-size
:
12px
;
text-align
:
center
;
text-align
:
center
;
color
:
#999
;
color
:
#999
;
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment