Commit 0a94f49b by Lyan

优化

parent 88284ee9
...@@ -130,8 +130,9 @@ export default { ...@@ -130,8 +130,9 @@ export default {
const { returnCode, data ,returnMsg} = listRes; const { returnCode, data ,returnMsg} = listRes;
if (returnCode === "0" && data !=null) { if (returnCode === "0" && data !=null) {
localStorage.setItem("msg"+id, JSON.stringify(data)); localStorage.setItem("msg"+id, JSON.stringify(data));
localStorage.setItem("isList"+id, 1);
let link = this.$router.resolve({ let link = this.$router.resolve({
path: `/News/msg?id=${id}&isList=1`, path: `/News/msg?id=${id}`,
}); });
window.open(link.href,'_blank') window.open(link.href,'_blank')
......
...@@ -215,7 +215,7 @@ export default { ...@@ -215,7 +215,7 @@ export default {
}; };
}, },
created() { created() {
if(this.$route.query.isList && this.$route.query.isList == 1){ if(JSON.parse(localStorage.getItem('isList'+this.id)) && JSON.parse(localStorage.getItem('isList'+this.id)) == 1){
let matche=[ let matche=[
{ {
name: "中心活动", name: "中心活动",
...@@ -245,6 +245,7 @@ export default { ...@@ -245,6 +245,7 @@ export default {
mounted() { mounted() {
window.onbeforeunload = () => { window.onbeforeunload = () => {
localStorage.removeItem('msg'+this.id) localStorage.removeItem('msg'+this.id)
localStorage.removeItem('isList'+this.id)
} }
}, },
methods: { methods: {
......
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