no message

This commit is contained in:
小陌 2023-07-03 21:42:11 +08:00
parent 6bb6e24944
commit 3990dbb966
5 changed files with 11 additions and 7 deletions

View File

@ -110,7 +110,7 @@
filterObj(){ filterObj(){
const obj = {} const obj = {}
this.filter.forEach((item) => { this.filter.forEach((item) => {
if (!this.data[item.name] || this.data[item.name] == '') { if (this.data[item.name] === undefined || this.data[item.name] === null || JSON.stringify(this.data[item.name]) === '') {
return ; // return ; //
} }
if (item.options && item.options.items && item.options.items.length>0) { if (item.options && item.options.items && item.options.items.length>0) {
@ -119,8 +119,12 @@
item.operator = foundItem.operator; item.operator = foundItem.operator;
} }
} }
obj[item.name] = item.operator ? this.data[item.name]+`${config.separator}${item.operator}` : this.data[item.name] obj[item.name] = item.operator ? this.data[item.name]+`${config.separator}${item.operator}` : this.data[item.name]
}) })
console.log(obj)
return obj return obj
} }
}, },

View File

@ -38,7 +38,7 @@ router.beforeEach(async (to, from, next) => {
NProgress.start() NProgress.start()
//动态标题 //动态标题
document.title = to.meta.title ? `${to.meta.title} - ${config.APP_NAME}` : `${config.APP_NAME}` 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") { if (to.path === "/login") {
//删除路由(替换当前layout路由) //删除路由(替换当前layout路由)
router.addRoute(routes[0]) router.addRoute(routes[0])

View File

@ -11,7 +11,7 @@ axios.defaults.timeout = sysConfig.TIMEOUT
// HTTP request 拦截器 // HTTP request 拦截器
axios.interceptors.request.use( axios.interceptors.request.use(
(config) => { (config) => {
let token = tool.cookie.get("token"); let token = tool.cookie.get('X-PHPSSESSION');
if (token) { if (token) {
config.headers[sysConfig.TOKEN_NAME] = sysConfig.TOKEN_PREFIX + token config.headers[sysConfig.TOKEN_NAME] = sysConfig.TOKEN_PREFIX + token
} }

View File

@ -70,7 +70,7 @@
return false return false
} }
this.$tool.cookie.set("token", user.data.token, { this.$tool.cookie.set('X-PHPSSESSION', user.data.token, {
expires: 86400*360 expires: 86400*360
}) })

View File

@ -107,7 +107,7 @@
} }
}, },
created: function() { created: function() {
this.$tool.cookie.remove("token") this.$tool.cookie.remove('X-PHPSSESSION')
this.$tool.data.remove("user") this.$tool.data.remove("user")
this.$tool.data.remove("menu") this.$tool.data.remove("menu")
this.$tool.data.remove("permissions") this.$tool.data.remove("permissions")
@ -144,7 +144,7 @@
}else if(res.code==200){ }else if(res.code==200){
this.showWechatLogin = false this.showWechatLogin = false
this.$tool.cookie.set("token", res.data.token, { this.$tool.cookie.set('X-PHPSSESSION', res.data.token, {
expires: 86400*360 expires: 86400*360
}) })