Commit 0086c2b01dd01cd1ea8b5d841ad6a92dd6b407e4
1 parent
6f79367d
Exists in
master
fix:学校选择bug修复
Showing
2 changed files
with
7 additions
and
3 deletions
Show diff stats
src/views/Home/Home.vue
... | ... | @@ -89,7 +89,11 @@ export default { |
89 | 89 | if (isElder) { |
90 | 90 | this.isElder = true |
91 | 91 | } |
92 | - this.schoolNamesChoose = localStorage.getItem('schoolNamesChoose') ? localStorage.getItem('schoolNamesChoose') : '' | |
92 | + | |
93 | + let schoolNamesChoose = localStorage.getItem('schoolNamesChoose') | |
94 | + if (schoolNamesChoose) { | |
95 | + this.schoolNamesChoose = JSON.parse(schoolNamesChoose) | |
96 | + } | |
93 | 97 | this.centerNo = localStorage.getItem('centerNo'); |
94 | 98 | this.getUserInfo() |
95 | 99 | this.againRZ() | ... | ... |
src/views/Travel/schoolFollow.vue
... | ... | @@ -33,8 +33,8 @@ export default { |
33 | 33 | methods: { |
34 | 34 | //切换学校 |
35 | 35 | switchSchool(v) { |
36 | - localStorage.setItem('schoolNamesChoose',v) | |
37 | - this.$router.push({name : localStorage.getItem('prePage')}) | |
36 | + localStorage.setItem('schoolNamesChoose',,JSON.stringify(v)) | |
37 | + this.$router.push({name : 'Home'}) | |
38 | 38 | }, |
39 | 39 | getList() { |
40 | 40 | this.schoolList = JSON.parse(localStorage.getItem('schoolNames')) | ... | ... |