diff --git a/src/router/index.js b/src/router/index.js index 421a137..ac4f0d7 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -5,7 +5,7 @@ import { constantRouterMap } from './router.config.js' import { checkWxmpRegister, login } from '@/api/user' import { title } from '@/config' -const whiteList = ['/login', '/register', '/errorPage','/selectAgency','/houseQR','/'] +const whiteList = ['/login', '/register', '/errorPage','/selectAgency','/houseQR'] const originalPush = Router.prototype.push Router.prototype.push = function push(location, onResolve, onReject) { if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject) @@ -50,9 +50,9 @@ function paramsFormat(params) { } router.beforeEach((to, from, next) => { - console.log(to); let urlParams = getQueryParams() if(urlParams.houseId){ + console.log(urlParams); store.commit('SET_HOUSE_ID', urlParams.houseId) }else{ store.commit('SET_HOUSE_ID', null) @@ -96,19 +96,18 @@ router.beforeEach((to, from, next) => { login({ wxCode: getQueryStringByName('code'),appId:'wx1078fa1e99424de9'}).then(res => { localStorage.setItem('token', res.token) localStorage.setItem('userId', res.userH5DTO.id) - if(!res.userH5DTO.agencyId)next({ path: '/selectAgency'}) let state = decodeURIComponent(getQueryStringByName('state')) state = state.replace(/[\\\b\f\n\r\t]/g, '') state = state.replace(/(\s*?{\s*?|\s*?,\s*?)(['"])?([a-zA-Z0-9]+)(['"])?:/g, '$1"$3":') state = state - .replace(/":/g, '":') - .replace(/,"/g, ',"') + .replace(/":/g, '":"') + .replace(/,"/g, '","') .replace(/},/g, '"},') .replace(/}]/g, '"}]') .replace(/}}/g, '"}}') - - .replace(/:{"}/g, ':{}"') - console.log(state) + .replace(/"{/g, '{') + .replace(/:{"}/g, ':{}') + state = JSON.stringify({ path: '/', query: {} }); let path = `${location.origin}${location.pathname === '/' ? '' : location.pathname}` if (state && state != 'undefined') { state = JSON.parse(state) diff --git a/src/views/discussion/index.vue b/src/views/discussion/index.vue index ed749d2..3685240 100644 --- a/src/views/discussion/index.vue +++ b/src/views/discussion/index.vue @@ -59,7 +59,7 @@ export default { let parm = { pageSize: 10, pageNo: 1, - agencyId: null, + agencyId: this.agencyId, icEventId:null, content:this.searchValue } @@ -101,7 +101,7 @@ export default { let parm = { pageSize: 10, pageNo: 1, - agencyId: null, + agencyId: this.agencyId, icEventId:null } diff --git a/src/views/home/index.vue b/src/views/home/index.vue index 1184723..c26008c 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -103,8 +103,8 @@
-
-
+
+
{{ item.title }} diff --git a/src/views/register/index.vue b/src/views/register/index.vue index 297244e..5e121f7 100644 --- a/src/views/register/index.vue +++ b/src/views/register/index.vue @@ -88,10 +88,10 @@ export default { return } editUser(params).then(res => { - localStorage.setItem('token', res.token) + // localStorage.setItem('token', res.token) this.$toast.success('注册成功') let query = this.$route.query - this.$router.replace({ path: query.redirect, query: query.params ? JSON.parse(query.params) : {} }) + this.$router.go(-1) }) }, getCode() { diff --git a/src/views/userInfo/index.vue b/src/views/userInfo/index.vue index e31e847..b8ddc1b 100644 --- a/src/views/userInfo/index.vue +++ b/src/views/userInfo/index.vue @@ -143,15 +143,16 @@ export default { } }, methods: { - init() { + async init() { this.type = this.$route.params.type ? this.$route.params.type : '' document.title = this.$route.params.type === 'edit' ? '编辑' : '注册' this.userInfo = this.$store.state.app.userInfo - console.log(this.userInfo, 'this.userInfo'); if (this.type === 'edit') { this.surName = this.userInfo.realName; this.gender = this.userInfo.sex; - this.streetId = this.userInfo.streetId; + let streetId = this.userInfo.orgIdPath.split(':'); + this.streetId = streetId[streetId.length - 2] + await this.getChildAgencyByPid() this.customerId = this.userInfo.customerId; this.communityId = this.userInfo.agencyId; this.idNum = this.userInfo.idNum;