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 11c31327
authored
Sep 23, 2022
by
张杰
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
v1.11.0版本需求
1 parent
1d28ec2f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
73 additions
and
64 deletions
src/App.vue
src/App.vue
View file @
11c3132
...
...
@@ -13,83 +13,92 @@
</
template
>
<
script
>
import
Dashboard
from
'@/views/Dashboard'
;
import
Login
from
'@/views/Login'
;
import
Loading
from
'components/Loading/Loading'
;
import
microAppStart
from
"./micro/auth"
import
actions
from
"@/micro/app-store"
;
import
Dashboard
from
"@/views/Dashboard"
;
import
Login
from
"@/views/Login"
;
import
Loading
from
"components/Loading/Loading"
;
import
microAppStart
from
"./micro/auth"
;
import
actions
from
"@/micro/app-store"
;
import
{
onCreated
,
onMounted
,
computed
,
reactive
,
toRefs
}
from
'vue'
;
import
{
useStore
}
from
'vuex'
;
import
{
onCreated
,
onMounted
,
computed
,
reactive
,
toRefs
}
from
"vue"
;
import
{
useStore
}
from
"vuex"
;
import
{
Common
}
from
"@/utils/common/common"
;
export
default
{
name
:
"App"
,
components
:
{
Dashboard
,
Login
,
Loading
},
setup
()
{
const
store
=
useStore
();
name
:
"App"
,
components
:
{
Dashboard
,
Login
,
Loading
,
},
setup
()
{
const
store
=
useStore
();
let
hasToken
=
computed
(()
=>
{
let
tokenStatus
=
!!
store
.
getters
.
token
;
// let flag = true;
// if(tokenStatus && flag) {
// microAppStart();
// flag = false;
// }
return
tokenStatus
;
})
let
showLoading
=
computed
(()
=>
{
return
store
.
getters
.
showLoading
;
})
// 判断页面是否通过window.open 打开(v1.7.0版本地图页面操作是打开新窗口 将菜单栏隐藏)
let
flag
=
true
let
locationHash
=
window
.
location
.
hash
let
hiddenMenu
=
Common
.
hiddenMenu
hiddenMenu
.
map
(
val
=>
{
if
(
locationHash
.
indexOf
(
val
)
>
-
1
&&
locationHash
.
indexOf
(
'?'
)
>
-
1
)
{
flag
=
false
}
})
if
(
!
flag
)
{
const
store
=
useStore
()
store
.
state
.
collapsed
=
true
store
.
dispatch
(
'app/setCollapsed'
,
true
)
actions
.
setGlobalState
({
isCollapsed
:
true
})
onMounted
(()
=>
{
let
flag
=
true
;
let
tokenStatus
=
!!
store
.
getters
.
token
;
if
(
tokenStatus
&&
flag
)
{
microAppStart
();
flag
=
false
;
}
return
{
hasToken
,
showLoading
});
let
hasToken
=
computed
(()
=>
{
let
tokenStatus
=
!!
store
.
getters
.
token
;
// let flag = true;
// if(tokenStatus && flag) {
// microAppStart();
// flag = false;
// }
return
tokenStatus
;
});
let
showLoading
=
computed
(()
=>
{
return
store
.
getters
.
showLoading
;
});
// 判断页面是否通过window.open 打开(v1.7.0版本地图页面操作是打开新窗口 将菜单栏隐藏)
let
flag
=
true
;
let
locationHash
=
window
.
location
.
hash
;
let
hiddenMenu
=
Common
.
hiddenMenu
;
hiddenMenu
.
map
((
val
)
=>
{
if
(
locationHash
.
indexOf
(
val
)
>
-
1
&&
locationHash
.
indexOf
(
"?"
)
>
-
1
)
{
flag
=
false
;
}
},
//$globalActions:actions
}
});
if
(
!
flag
)
{
const
store
=
useStore
();
store
.
state
.
collapsed
=
true
;
store
.
dispatch
(
"app/setCollapsed"
,
true
);
actions
.
setGlobalState
({
isCollapsed
:
true
});
}
return
{
hasToken
,
showLoading
,
};
},
//$globalActions:actions
};
</
script
>
<
style
lang=
"less"
>
.layout-container
{
height
:
100vh
;
height
:
100vh
;
#desktop-right-sider
.trigger
{
font-size
:
18px
;
line-height
:
64px
;
padding
:
0
24px
;
cursor
:
pointer
;
transition
:
color
0.3s
;
}
#desktop-right-sider
.trigger
{
font-size
:
18px
;
line-height
:
64px
;
padding
:
0
24px
;
cursor
:
pointer
;
transition
:
color
0.3s
;
}
#desktop-right-sider
.trigger
:hover
{
color
:
#1890ff
;
}
#desktop-right-sider
.trigger
:hover
{
color
:
#1890ff
;
}
#desktop-right-sider
.logo
{
height
:
32px
;
background
:
rgba
(
255
,
255
,
255
,
0.2
);
margin
:
16px
;
}
#desktop-right-sider
.logo
{
height
:
32px
;
background
:
rgba
(
255
,
255
,
255
,
0.2
);
margin
:
16px
;
}
}
</
style
>
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