缺少404页面
This commit is contained in:
parent
0da68d63f3
commit
5b76549a19
|
@ -31,11 +31,6 @@ import Layout from '@/layout'
|
||||||
* all perms can be accessed
|
* all perms can be accessed
|
||||||
*/
|
*/
|
||||||
export const constantRoutes = [
|
export const constantRoutes = [
|
||||||
{
|
|
||||||
path: '/login',
|
|
||||||
component: () => import('@/views/login/index'),
|
|
||||||
hidden: true
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
path: '/',
|
path: '/',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
|
@ -47,6 +42,16 @@ export const constantRoutes = [
|
||||||
meta: { title: '首页', icon: 'dashboard' }
|
meta: { title: '首页', icon: 'dashboard' }
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/login',
|
||||||
|
component: () => import('@/views/login/index'),
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/404',
|
||||||
|
component: () => import('@/views/404'),
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/myinfo',
|
path: '/myinfo',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
|
@ -248,21 +253,22 @@ export const asyncRoutes = [
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{ path: '*', redirect: '/404', hidden: true }
|
// 404 page must be placed at the end !!!
|
||||||
]
|
{ path: '*', redirect: '/404', hidden: true }
|
||||||
|
]
|
||||||
const createRouter = () => new Router({
|
|
||||||
// mode: 'history', // require service support
|
const createRouter = () => new Router({
|
||||||
scrollBehavior: () => ({ y: 0 }),
|
// mode: 'history', // require service support
|
||||||
routes: constantRoutes
|
scrollBehavior: () => ({ y: 0 }),
|
||||||
})
|
routes: constantRoutes
|
||||||
|
})
|
||||||
const router = createRouter()
|
|
||||||
|
const router = createRouter()
|
||||||
// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
|
|
||||||
export function resetRouter() {
|
// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
|
||||||
const newRouter = createRouter()
|
export function resetRouter() {
|
||||||
router.matcher = newRouter.matcher // reset router
|
const newRouter = createRouter()
|
||||||
}
|
router.matcher = newRouter.matcher // reset router
|
||||||
|
}
|
||||||
export default router
|
|
||||||
|
export default router
|
|
@ -95,18 +95,22 @@ const actions = {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
getInfo(state.token).then(response => {
|
getInfo(state.token).then(response => {
|
||||||
const { data } = response
|
const { data } = response
|
||||||
|
|
||||||
|
if (!data) {
|
||||||
|
reject('验证失败,重新登陆.')
|
||||||
|
}
|
||||||
|
|
||||||
const { perms, name, avatar } = data
|
const { perms, name, avatar } = data
|
||||||
|
|
||||||
// perms must be a non-empty array
|
// perms must be a non-empty array
|
||||||
if (!perms || perms.length <= 0) {
|
if (!perms || perms.length <= 0) {
|
||||||
reject('没有任何权限!')
|
reject('没有任何权限!')
|
||||||
}
|
}
|
||||||
|
|
||||||
commit('SET_PERMS', perms)
|
commit('SET_PERMS', perms)
|
||||||
commit('SET_NAME', name)
|
commit('SET_NAME', name)
|
||||||
commit('SET_AVATAR', avatar)
|
commit('SET_AVATAR', avatar)
|
||||||
resolve(data)
|
resolve(data)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
reject(error)
|
reject(error)
|
||||||
})
|
})
|
||||||
|
|
|
@ -406,7 +406,6 @@ export default {
|
||||||
this.multipleSelection = val;
|
this.multipleSelection = val;
|
||||||
},
|
},
|
||||||
filterChange(obj) {
|
filterChange(obj) {
|
||||||
console.log(obj)
|
|
||||||
for (let key in obj) {
|
for (let key in obj) {
|
||||||
this.listQuery[key] = obj[key][0];
|
this.listQuery[key] = obj[key][0];
|
||||||
}
|
}
|
||||||
|
|
|
@ -256,7 +256,6 @@ export default {
|
||||||
},
|
},
|
||||||
getList() {
|
getList() {
|
||||||
this.listLoading = true;
|
this.listLoading = true;
|
||||||
console.log(this.listQuery)
|
|
||||||
getInspectionList(this.listQuery).then((response) => {
|
getInspectionList(this.listQuery).then((response) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
this.istList = response.data;
|
this.istList = response.data;
|
||||||
|
@ -272,7 +271,6 @@ export default {
|
||||||
data.group_by = key;
|
data.group_by = key;
|
||||||
getInspectionGroup(data).then((response) => {
|
getInspectionGroup(data).then((response) => {
|
||||||
this.groupBy[key] = response.data;
|
this.groupBy[key] = response.data;
|
||||||
console.log(this.groupBy);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -58,7 +58,7 @@
|
||||||
<div slot="header" class="clearfix">
|
<div slot="header" class="clearfix">
|
||||||
<span>待办任务提醒</span>
|
<span>待办任务提醒</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="litem" @click="goRecord('待上报')" v-if="!checkPermission(['record_confirm'])">
|
<div class="litem" @click="goRecord('待上报')" v-if="!checkPermission(['record_confirm']) && checkPermission(['record_up'])">
|
||||||
<el-link class="desc">
|
<el-link class="desc">
|
||||||
您有
|
您有
|
||||||
<span style="color:red">{{todos.toup}}</span>
|
<span style="color:red">{{todos.toup}}</span>
|
||||||
|
@ -66,13 +66,13 @@
|
||||||
</el-link>
|
</el-link>
|
||||||
</div>
|
</div>
|
||||||
<div class="litem">
|
<div class="litem">
|
||||||
<el-link class="desc" @click="goRecord('待整改')" v-if="!checkPermission(['record_confirm'])">
|
<el-link class="desc" @click="goRecord('待整改')" v-if="!checkPermission(['record_confirm']) && checkPermission(['record_up'])">
|
||||||
您有
|
您有
|
||||||
<span style="color:red">{{todos.tozg}}</span>
|
<span style="color:red">{{todos.tozg}}</span>
|
||||||
条记录待整改
|
条记录待整改
|
||||||
</el-link>
|
</el-link>
|
||||||
</div>
|
</div>
|
||||||
<div class="litem" @click="goRecord('已上报')">
|
<div class="litem" @click="goRecord('已上报')" v-if="checkPermission(['record_confirm'])">
|
||||||
<el-link class="desc" v-if="todos.toconfirm">
|
<el-link class="desc" v-if="todos.toconfirm">
|
||||||
您有
|
您有
|
||||||
<span style="color:red">{{todos.toconfirm}}</span>
|
<span style="color:red">{{todos.toconfirm}}</span>
|
||||||
|
|
|
@ -175,7 +175,6 @@ export default {
|
||||||
},
|
},
|
||||||
deleteFile(index){
|
deleteFile(index){
|
||||||
this.$confirm('确定删除该文件, 是否继续?', {type:'error'}).then(() => {
|
this.$confirm('确定删除该文件, 是否继续?', {type:'error'}).then(() => {
|
||||||
console.log(index)
|
|
||||||
this.fileList.splice(index)
|
this.fileList.splice(index)
|
||||||
}).catch(e=>{})
|
}).catch(e=>{})
|
||||||
},
|
},
|
||||||
|
|
|
@ -394,7 +394,7 @@ export default {
|
||||||
this.$message.success("成功");
|
this.$message.success("成功");
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.error(err);
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
async confirm(form) {
|
async confirm(form) {
|
||||||
|
|
Loading…
Reference in New Issue