Commit 21035ab7 by wangyalan-git

文档下载,搜索,最新上传,下载排行

parent 0b8330a0
...@@ -24,13 +24,16 @@ a:link,a:visited,a:hover { text-decoration:none;} //未访问:蓝色、无下 ...@@ -24,13 +24,16 @@ a:link,a:visited,a:hover { text-decoration:none;} //未访问:蓝色、无下
//align-items: center; //align-items: center;
//background: #dcdcdc; //background: #dcdcdc;
} }
img{
object-fit: contain;
}
.input-width{ .input-width{
width: 500px; width: 500px;
} }
.container{ .container{
width: 1200px; width: 1200px;
margin: 0 auto; margin: 0 auto;
//padding: 4% 0; padding: 4% 0;
} }
import Vue from 'vue' import Vue from 'vue'
import VueRouter from 'vue-router' import VueRouter from 'vue-router'
import Layout from '@/views/layout/Layout' import Layout from '@/views/layout/Layout'
Vue.use(VueRouter) Vue.use(VueRouter)
const routes = [ const routes = [
{ path: '/login', component: () => import('@/views/login/index'), hidden: true }, {
{ path: '/forget', component: () => import('@/views/login/forgetPwd'), hidden: true }, path: '/login',
{ path: '/404', component: () => import('@/views/404'), hidden: true }, name: 'login',
component: () => import('@/views/login/index'),
hidden: true
},
{
path: '/404',
component: () => import('@/views/404'),
hidden: true
},
{ {
path: '', path: '',
component: Layout, component: Layout,
...@@ -20,6 +29,11 @@ const routes = [ ...@@ -20,6 +29,11 @@ const routes = [
name: 'search', name: 'search',
component: () => import('@/views/search/index.vue') component: () => import('@/views/search/index.vue')
}] }]
},
{
path: '*',
redirect: '/404',
hidden: true
} }
] ]
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
import axios from 'axios' import axios from 'axios'
import { Message, MessageBox } from 'element-ui' import { Message, MessageBox } from 'element-ui'
import store from '../store' import store from '../store'
import router from '../router'
import { getToken } from '@/utils/auth' import { getToken } from '@/utils/auth'
// 创建axios实例 // 创建axios实例
const service = axios.create({ const service = axios.create({
...@@ -51,7 +52,10 @@ service.interceptors.response.use( ...@@ -51,7 +52,10 @@ service.interceptors.response.use(
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
store.dispatch('FedLogOut').then(() => { store.dispatch('FedLogOut').then(() => {
location.reload()// 为了重新实例化vue-router对象 避免bug console.log('重新登录',router)
router.replace({
name: 'login'
})
}) })
}) })
} }
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
autoComplete="on" autoComplete="on"
placeholder="请输入用户名"> placeholder="请输入用户名">
<span slot="prefix"> <span slot="prefix">
<i class="el-icon-user-solid"/> <i class="el-icon-user"/>
</span> </span>
</el-input> </el-input>
</el-form-item> </el-form-item>
...@@ -155,7 +155,7 @@ export default { ...@@ -155,7 +155,7 @@ export default {
.container { .container {
position: relative; position: relative;
width: 100%; width: 100%;
height: 100vh; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
...@@ -168,7 +168,7 @@ export default { ...@@ -168,7 +168,7 @@ export default {
.container .content { .container .content {
width: 60%; width: 60%;
padding: 3%; padding: 3%;
height: 70%; height: 60%;
background: #FFFFFF; background: #FFFFFF;
border-radius: 10px; border-radius: 10px;
display: flex; display: flex;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment