diff --git a/src/components/scFilterBar/index.vue b/src/components/scFilterBar/index.vue index c22f3ce..a60fc53 100644 --- a/src/components/scFilterBar/index.vue +++ b/src/components/scFilterBar/index.vue @@ -110,8 +110,8 @@ filterObj(){ const obj = {} this.filter.forEach((item) => { - if (!this.data[item.name] || this.data[item.name] == '') { - return; // 跳过当前迭代,继续下一次迭代 + if (this.data[item.name] === undefined || this.data[item.name] === null || JSON.stringify(this.data[item.name]) === '') { + return ; // 跳过当前迭代,继续下一次迭代 } if (item.options && item.options.items && item.options.items.length>0) { const foundItem = item.options.items.find(o => o.value === this.data[item.name]); @@ -119,8 +119,12 @@ item.operator = foundItem.operator; } } + obj[item.name] = item.operator ? this.data[item.name]+`${config.separator}${item.operator}` : this.data[item.name] }) + + console.log(obj) + return obj } }, diff --git a/src/router/index.js b/src/router/index.js index ea20901..24a0c28 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -38,7 +38,7 @@ router.beforeEach(async (to, from, next) => { NProgress.start() //动态标题 document.title = to.meta.title ? `${to.meta.title} - ${config.APP_NAME}` : `${config.APP_NAME}` - let token = tool.cookie.get("token"); + let token = tool.cookie.get('X-PHPSSESSION'); if (to.path === "/login") { //删除路由(替换当前layout路由) router.addRoute(routes[0]) diff --git a/src/utils/request.js b/src/utils/request.js index bf5aad3..3b7c978 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -11,7 +11,7 @@ axios.defaults.timeout = sysConfig.TIMEOUT // HTTP request 拦截器 axios.interceptors.request.use( (config) => { - let token = tool.cookie.get("token"); + let token = tool.cookie.get('X-PHPSSESSION'); if (token) { config.headers[sysConfig.TOKEN_NAME] = sysConfig.TOKEN_PREFIX + token } diff --git a/src/views/login/components/passwordForm.vue b/src/views/login/components/passwordForm.vue index 445483c..e4c52f9 100644 --- a/src/views/login/components/passwordForm.vue +++ b/src/views/login/components/passwordForm.vue @@ -70,7 +70,7 @@ return false } - this.$tool.cookie.set("token", user.data.token, { + this.$tool.cookie.set('X-PHPSSESSION', user.data.token, { expires: 86400*360 }) diff --git a/src/views/login/index.vue b/src/views/login/index.vue index ce77ebb..aa833d3 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -107,7 +107,7 @@ } }, created: function() { - this.$tool.cookie.remove("token") + this.$tool.cookie.remove('X-PHPSSESSION') this.$tool.data.remove("user") this.$tool.data.remove("menu") this.$tool.data.remove("permissions") @@ -144,7 +144,7 @@ }else if(res.code==200){ this.showWechatLogin = false - this.$tool.cookie.set("token", res.data.token, { + this.$tool.cookie.set('X-PHPSSESSION', res.data.token, { expires: 86400*360 })