Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dcxy-manage-shell
Project
Overview
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
姜雷
dcxy-manage-shell
Commits
3b4d2c11
Commit
3b4d2c11
authored
Mar 27, 2019
by
姜雷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改处理路由方式并添加处理方法
parent
2ea0ddae
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
13 deletions
+20
-13
main.js
src/lib/main.js
+3
-11
utils.js
src/lib/utils.js
+2
-0
main.js
src/main.js
+15
-2
No files found.
src/lib/main.js
View file @
3b4d2c11
...
...
@@ -36,7 +36,6 @@ class SystemShell {
extendCom
(
Vue
);
configRoutePermission
(
router
,
store
,
routers
);
Vue
.
config
.
productionTip
=
false
;
console
.
log
(
router
);
let
app
=
new
Vue
({
el
:
'#app'
,
...
...
@@ -46,16 +45,9 @@ class SystemShell {
let
routes
=
[...
constantRouterMap
];
let
allRoute
=
store
.
getters
.
asyncRoutes
;
if
(
typeof
routeFilter
===
'function'
)
{
allRoute
=
routeFilter
(
allRoute
);
}
if
(
allRoute
&&
allRoute
.
length
)
{
let
addRoute
=
formatRouteLink
(
allRoute
);
for
(
let
index
=
0
;
index
<
addRoute
.
length
;
index
++
)
{
const
element
=
addRoute
[
index
];
if
(
element
.
children
)
{
routes
=
routes
.
concat
(
element
.
children
);
}
}
const
data
=
routeFilter
(
routes
,
allRoute
);
routes
=
data
.
routes
;
allRoute
=
data
.
allRoute
;
}
return
<
App
route
=
{
routes
}
allRoutes
=
{
allRoute
}
/>
;
},
...
...
src/lib/utils.js
View file @
3b4d2c11
import
*
as
main
from
'../utils/index'
;
import
*
as
auth
from
'../utils/auth'
;
import
*
as
route
from
'../utils/route'
;
import
downloadUrl
from
'../utils/download'
;
import
{
getYourIP
}
from
'../utils/getIp'
;
import
*
as
validate
from
'../utils/validate'
;
...
...
@@ -7,6 +8,7 @@ import * as validate from '../utils/validate';
export
default
{
...
main
,
auth
,
route
,
downloadFiles
:
downloadUrl
,
getIp
:
getYourIP
,
validate
,
...
...
src/main.js
View file @
3b4d2c11
import
System
from
'./lib/main'
;
console
.
log
(
System
);
let
allAasyncRouterMap
=
[
...
customerManage
.
default
,
...
baseManage
.
default
,
...
...
@@ -11,4 +9,19 @@ let allAasyncRouterMap = [
System
.
createSystem
({
basePath
:
process
.
env
.
VUE_APP_BASE_URL
,
routers
:
allAasyncRouterMap
,
routeFilter
:
(
routes
,
allRoute
)
=>
{
if
(
allRoute
&&
allRoute
.
length
)
{
let
addRoute
=
System
.
utils
.
route
.
formatRouteLink
(
allRoute
);
for
(
let
index
=
0
;
index
<
addRoute
.
length
;
index
++
)
{
const
element
=
addRoute
[
index
];
if
(
element
.
children
)
{
routes
=
routes
.
concat
(
element
.
children
);
}
}
}
return
{
allRoute
,
routes
,
};
},
});
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