File tree Expand file tree Collapse file tree 7 files changed +19
-31
lines changed Expand file tree Collapse file tree 7 files changed +19
-31
lines changed Original file line number Diff line number Diff line change 1
1
ENV = ' development'
2
2
3
- VUE_APP_BASE_URL = ' http://localhost :5000/'
3
+ VUE_APP_BASE_URL = ' http://127.0.0.1 :5000/'
Original file line number Diff line number Diff line change 1
1
2
2
3
- VUE_APP_BASE_URL = ' http://localhost :5000/'
3
+ VUE_APP_BASE_URL = ' http://127.0.0.1 :5000/'
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " lin-cms" ,
3
- "version" : " 0.3.5 " ,
3
+ "version" : " 0.3.6 " ,
4
4
"private" : true ,
5
5
"scripts" : {
6
6
"serve" : " node script/plugin-get-config.js && vue-cli-service serve" ,
Original file line number Diff line number Diff line change 55
55
layout =" prev, pager, next"
56
56
:page-size =" pagination.pageSize ? pagination.pageSize : 10"
57
57
:total =" pagination.pageTotal ? pagination.pageTotal : null"
58
+ :current-page =" pagination.currentPage ? pagination.currentPage : 1"
58
59
@current-change =" currentChange"
59
60
></el-pagination >
60
61
</div >
Original file line number Diff line number Diff line change 77
77
</el-submenu >
78
78
79
79
<!-- 一级else -->
80
- <el-menu-item
81
- class =" subMenuContent"
82
- :index =" idMap[item.name]"
83
- @click =" goto(item.path)"
84
- v-else
85
- :key =" idMap[item.name]"
86
- >
87
- <i v-if =" !filterIcon(item.icon)" :class =" item.icon" ></i > <img v-else :src =" item.icon" class =" imgIcon" />
88
- <span slot =" title" >{{ item.title }}</span >
89
- </el-menu-item >
80
+ <router-link :to =" item.path" :key =" item.name" v-else >
81
+ <el-menu-item class =" subMenuContent" :index =" idMap[item.name]" :key =" idMap[item.name]" >
82
+ <i v-if =" !filterIcon(item.icon)" :class =" item.icon" ></i > <img v-else :src =" item.icon" class =" imgIcon" />
83
+ <span slot =" title" >{{ item.title }}</span >
84
+ </el-menu-item >
85
+ </router-link >
90
86
</template >
91
87
</el-menu >
92
88
</div >
@@ -118,7 +114,6 @@ export default {
118
114
default: false ,
119
115
},
120
116
},
121
- created () {},
122
117
mounted () {
123
118
this .eventBus .$on (' removeSidebarSearch' , () => {
124
119
this .showSidebarSearch = false
@@ -130,11 +125,6 @@ export default {
130
125
})
131
126
},
132
127
methods: {
133
- goto (path ) {
134
- this .$router .push ({
135
- path,
136
- })
137
- },
138
128
filterIcon (icon ) {
139
129
return icon .indexOf (' /' ) !== - 1
140
130
},
@@ -151,10 +141,6 @@ export default {
151
141
}, 200 )
152
142
},
153
143
search (val ) {
154
- // if (!val) {
155
- // this.showSearchList = false
156
- // return
157
- // }
158
144
this .groups = []
159
145
160
146
// 深度遍历配置树, 摘取叶子节点作为路由部分
Original file line number Diff line number Diff line change 1
1
const errorCode = {
2
2
777 : '前端错误码未定义' ,
3
3
999 : '服务器未知错误' ,
4
- 10000 : '认证失败 ' ,
4
+ 10000 : '未携带令牌 ' ,
5
5
10020 : '资源不存在' ,
6
6
10030 : '参数错误' ,
7
- 10040 : 'assessToken令牌失效' ,
8
- 10050 : 'assessToken令牌过期' ,
7
+ 10041 : 'assessToken损坏' ,
8
+ 10042 : 'refreshToken损坏' ,
9
+ 10051 : 'assessToken过期' ,
10
+ 10052 : 'refreshToken过期' ,
9
11
10060 : '字段重复' ,
10
12
10070 : '不可操作' ,
11
- 10100 : 'refreshToken异常' ,
12
13
}
13
14
14
15
export default errorCode
Original file line number Diff line number Diff line change @@ -116,17 +116,17 @@ _axios.interceptors.response.use(
116
116
return new Promise ( async ( resolve , reject ) => {
117
117
const { url } = res . config
118
118
119
- // refresh_token 异常 ,直接登出
120
- if ( code === 10000 || code === 10100 ) {
119
+ // refreshToken相关 ,直接登出
120
+ if ( code === 10000 || code === 10042 || code === 10052 ) {
121
121
setTimeout ( ( ) => {
122
122
store . dispatch ( 'loginOut' )
123
123
const { origin } = window . location
124
124
window . location . href = origin
125
125
} , 1500 )
126
126
return resolve ( null )
127
127
}
128
- // 令牌相关 ,刷新令牌
129
- if ( code === 10040 || code === 10041 || code === 10050 || code === 10051 ) {
128
+ // assessToken相关 ,刷新令牌
129
+ if ( code === 10041 || code === 10051 ) {
130
130
const cache = { }
131
131
if ( cache . url !== url ) {
132
132
cache . url = url
You can’t perform that action at this time.
0 commit comments