|
@@ -86,7 +86,8 @@ export default {
|
|
|
},
|
|
|
beforeMount() {},
|
|
|
created() {
|
|
|
- store.commit('SETSSOTOKEN', 'admin:liujiandong')
|
|
|
+ this.handleUrl()
|
|
|
+ // store.commit('SETSSOTOKEN', 'admin:liujiandong')
|
|
|
// console.log(window.location.href)
|
|
|
this.SETHAVEFENGMAP(false)
|
|
|
// 判断 安卓,ios
|
|
@@ -113,7 +114,7 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
...mapActions(['getfmapID', 'getFloors']),
|
|
|
- ...mapMutations(['SETHAVEFENGMAP', 'SETCATEGORYID', 'SETSMSXT']),
|
|
|
+ ...mapMutations(['SETHAVEFENGMAP', 'SETCATEGORYID', 'SETSMSXT', 'SETSSOTOKEN', 'SETPLAZAID']),
|
|
|
getFengMap() {
|
|
|
this.getfmapID().then(() => {
|
|
|
this.getMap()
|
|
@@ -156,7 +157,7 @@ export default {
|
|
|
// console.log(active)
|
|
|
if (active == 1) {
|
|
|
this.SETCATEGORYID('LCGN')
|
|
|
- this.SETSMSXT("")
|
|
|
+ this.SETSMSXT('')
|
|
|
}
|
|
|
this.$router.push({ name: this.routeDict[active] })
|
|
|
store.commit('SETAPPTITLE', this.titleDict[active])
|
|
@@ -167,6 +168,33 @@ export default {
|
|
|
getFloorList() {
|
|
|
this.getFloors()
|
|
|
},
|
|
|
+ /**
|
|
|
+ * 处理url参数
|
|
|
+ */
|
|
|
+ handleUrl() {
|
|
|
+ let url = window.location.href
|
|
|
+ let params = this.queryURLParams(url)
|
|
|
+ console.log('%c 路径参数:', 'color:blue')
|
|
|
+ console.log(params)
|
|
|
+ const { username, plazaId } = params
|
|
|
+ if (username) {
|
|
|
+ this.SETSSOTOKEN(`admin:${username}`)
|
|
|
+ }
|
|
|
+ if (plazaId) {
|
|
|
+ // TODO:
|
|
|
+ plazaId = '1000772'
|
|
|
+ this.SETPLAZAID(plazaId)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 查询url参数
|
|
|
+ */
|
|
|
+ queryURLParams(url) {
|
|
|
+ let obj = {}
|
|
|
+ url.replace(/([^?=&#]+)=([^?=&#]+)/g, (_, key, value) => (obj[key] = value))
|
|
|
+ url.replace(/#([^?=&#]+)/g, (_, hash) => (obj['HASH'] = hash))
|
|
|
+ return obj
|
|
|
+ },
|
|
|
},
|
|
|
watch: {
|
|
|
plazaId(plazaId) {
|