Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tsndu-web
Overview
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
魏吉光
tsndu-web
Commits
0eeca6f3
Commit
0eeca6f3
authored
Oct 24, 2020
by
weijiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
feb9957b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
31 deletions
+45
-31
src/libs/axios.js
+4
-2
src/main.js
+12
-14
src/view/company/companys/helper.js
+13
-15
src/view/main/index.js
+16
-0
No files found.
src/libs/axios.js
View file @
0eeca6f3
...
...
@@ -31,8 +31,9 @@ service.interceptors.response.use(
if
(
headers
[
"content-disposition"
])
{
return
{
file
:
data
,
fileName
:
headers
[
"content-disposition"
]
};
}
const
{
code
}
=
data
;
const
{
msg
}
=
data
;
const
{
code
,
msg
}
=
data
;
console
.
log
(
code
);
console
.
log
(
msg
);
switch
(
code
)
{
case
1
:
return
data
;
...
...
@@ -42,6 +43,7 @@ service.interceptors.response.use(
desc
:
msg
});
localStorage
.
removeItem
(
"token"
);
localStorage
.
removeItem
(
"tokenInfo"
);
router
.
push
(
"/"
);
return
data
;
case
3
:
...
...
src/main.js
View file @
0eeca6f3
...
...
@@ -10,22 +10,20 @@ import "./index.less";
Vue
.
config
.
productionTip
=
false
;
Vue
.
use
(
iView
);
// Viewer.setDefaults({
// zIndex: 99999999,
// url(image) {
// return image.getAttribute("url");
// }
// });
// Vue.use(Viewer);
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
if
(
to
.
path
==
"/"
)
{
// 判断该路由是否需要登录权限
const
tokenInfo
=
localStorage
.
getItem
(
"tokenInfo"
);
if
(
tokenInfo
)
{
router
.
push
(
"/main"
);
return
;
}
next
();
}
else
{
next
();
}
})
new
Vue
({
router
,
render
:
h
=>
h
(
App
)
}).
$mount
(
"#app"
)
// new Vue({
// el: '#app',
// router,
// components: { App },
// template: '<App/>'
// })
src/view/company/companys/helper.js
View file @
0eeca6f3
...
...
@@ -84,22 +84,20 @@ export const columns = (search, disable, enable, showEditExpired, showEdit, show
}
},
{
title
:
"省"
,
key
:
"province"
,
title
:
"地区"
,
align
:
"center"
,
minWidth
:
40
,
},
{
title
:
"市"
,
key
:
"city"
,
align
:
"center"
,
minWidth
:
40
,
},
{
title
:
"区"
,
key
:
"district"
,
align
:
"center"
,
minWidth
:
40
,
minWidth
:
80
,
render
(
h
,
{
row
})
{
try
{
const
{
province
,
city
,
district
}
=
row
;
if
(
province
||
city
||
district
)
{
return
h
(
"span"
,
`
${
province
}
/
${
city
}
/
${
district
}
`
);
}
return
h
(
"span"
,
`未知`
);
}
catch
(
e
)
{
console
.
log
(
e
);
}
}
},
{
title
:
"状态"
,
...
...
src/view/main/index.js
View file @
0eeca6f3
...
...
@@ -39,6 +39,21 @@ export default {
}
});
},
clearMenus
()
{
this
.
maps
=
[];
for
(
var
i
in
routers
)
{
var
router
=
routers
[
i
];
router
.
visable
=
false
;
if
(
!
router
.
children
||
router
.
children
.
length
<=
0
)
{
continue
;
}
for
(
var
j
in
router
.
children
)
{
var
childRouter
=
router
.
children
[
j
];
childRouter
.
visable
=
false
;
}
}
},
getMenuFromRouter
(
key
)
{
var
maps
=
[];
for
(
var
i
in
routers
)
{
...
...
@@ -82,6 +97,7 @@ export default {
}
},
mounted
()
{
this
.
clearMenus
();
this
.
setMenus
();
this
.
onMenuSelect
(
"home"
);
}
...
...
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