Commit 73dd5144 authored by zhangyanni's avatar zhangyanni

搜索

parent 73786f02
...@@ -336,6 +336,7 @@ ...@@ -336,6 +336,7 @@
let params = { let params = {
context:data context:data
} }
this.$store.dispatch('saveSearchResultKeyword',{path:this.$route.path,pars:data});
this.$router.push({path:"/search",query:{key:this.Base64.encode(data)}}); this.$router.push({path:"/search",query:{key:this.Base64.encode(data)}});
api.mixSearchAxios(params).then((res)=>{ api.mixSearchAxios(params).then((res)=>{
if(res.code==0){ if(res.code==0){
...@@ -430,7 +431,8 @@ ...@@ -430,7 +431,8 @@
let that = this; let that = this;
api.logoutAxios().then((res)=>{ api.logoutAxios().then((res)=>{
if(res.code==0){ if(res.code==0){
window.sessionStorage.removeItem("userInfo"); // window.sessionStorage.removeItem("userInfo");
window.sessionStorage.clear();
that.$router.push("/login"); that.$router.push("/login");
}else{ }else{
that.$message.error(res.msg); that.$message.error(res.msg);
......
...@@ -12,6 +12,7 @@ export default new Vuex.Store({ ...@@ -12,6 +12,7 @@ export default new Vuex.Store({
searchResultSmallBusiness:new Map(),//搜索结果小B分页 searchResultSmallBusiness:new Map(),//搜索结果小B分页
searchResult:new Map(),//搜索结果 searchResult:new Map(),//搜索结果
projectSearch:new Map(), projectSearch:new Map(),
saveSearchResultKeyword:new Map(),//搜索key
}, },
mutations: { mutations: {
SAVE_LIST_PAGE_PARS:(state,{path,pars})=>{ SAVE_LIST_PAGE_PARS:(state,{path,pars})=>{
...@@ -38,6 +39,10 @@ export default new Vuex.Store({ ...@@ -38,6 +39,10 @@ export default new Vuex.Store({
state.searchResult.set(path,pars) state.searchResult.set(path,pars)
}, },
SEARCH_RESULT_KEYWORD:(state,{path,pars})=>{//搜索key
state.saveSearchResultKeyword.set(path,pars)
},
pro_PARS:(state,{path,pars})=>{ pro_PARS:(state,{path,pars})=>{
state.projectSearch.set(path,pars); state.projectSearch.set(path,pars);
}, },
...@@ -66,6 +71,10 @@ export default new Vuex.Store({ ...@@ -66,6 +71,10 @@ export default new Vuex.Store({
commit('SEARCH_RESULT',{ path,pars }); commit('SEARCH_RESULT',{ path,pars });
}, },
saveSearchResultKeyword: ({ commit },{path,pars}) => {
commit('SEARCH_RESULT_KEYWORD',{ path,pars });
},
projectPagePars: ({ commit },{path,pars}) => { projectPagePars: ({ commit },{path,pars}) => {
commit('pro_PARS',{ path,pars }); commit('pro_PARS',{ path,pars });
}, },
......
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