Commit 9bce7d2c by 潘琦

1、解决微信分享出去链接被篡改问题;2、添加家庭成员,子女出生年月日;

parent 007b4941
......@@ -3,9 +3,8 @@
// see http://vuejs-templates.github.io/webpack for documentation.
const path = require('path')
// const url = 'http://voucher.check.icaremgt.com' // 开发
const url = 'http://voucher.check.icaremgt.com' // 开发
// const url = 'http://voucher.icaremgt.com' // 正式
const url = 'http://192.168.1.151:9999'
const sjkgurl = 'https://api-wx-service.check.icaremgt.com' // 机构空间(开发)
// const sjkgurl = 'https://sjkg-wx-service.icaremgt.com' // 机构空间(正式)
......
......@@ -6,11 +6,16 @@ import { getParamsByUrl, removeUrlParam } from '@/util/index'
import { getOauth, getUserByToken } from '@/api/auth/auth'
import baseUrl from '@/util/baseUrl'
import { Toast } from 'mint-ui'
import { wxpermission } from '@/wxpermission'
const defaultUrl = baseUrl.authUrl
router.beforeEach((to, from, next) => {
console.log('缓冲设置')
console.log('code ===' + store.getters.code)
// 判断链接是否被微信分享篡改,false需重定向
if (redirectUrl()) {
wxpermission(0, () => {})
// store.dispatch('setToken', '')
// store.dispatch('setUserId', '')
// let accessToken = store.getters.access_token
......@@ -28,6 +33,7 @@ router.beforeEach((to, from, next) => {
} else {
next()
}
}
// store.dispatch('setToken', '490cd9b7-dca7-4cc3-87e9-5eacbb5a5d77')
})
......@@ -132,6 +138,30 @@ const getUserByTokenFn = (token, code, callback) => {
})
}
// 判断链接是否被微信分享篡改
const redirectUrl = () => {
const curUrl = window.location.href
const curUrlArr = curUrl.split('?')
// Toast({
// message: curUrl,
// position: 'center',
// duration: 2 * 1000
// })
// console.log(curUrlArr[1].indexOf('from=singlemessage'))
if (curUrlArr.length === 3 && curUrlArr[1].indexOf('from=singlemessage') >= 0) {
let newUrl = curUrlArr[0] + '#' + curUrlArr[1].split('#')[1] + '?' + curUrlArr[2]
// Toast({
// message: curUrlArr[2],
// position: 'center',
// duration: 5 * 1000
// })
window.location.href = newUrl
return false
} else {
return true
}
}
// const nextToPath = (to, from, next) => {
// let toquery = to.query
// if (from.query.code) {
......
......@@ -217,10 +217,14 @@ export default {
this.BaseValidate.birthKidState = true
const selectedDate = new Date(date)
let month = selectedDate.getMonth() + 1
if (selectedDate.getMonth() + 1 <= 9) {
month = '0' + (selectedDate.getMonth() + 1)
if (month < 10) {
month = '0' + month
}
let day = selectedDate.getDate()
if (day < 10) {
day = '0' + day
}
this.userData.birthKid = selectedDate.getFullYear() + '-' + month + '-' + selectedDate.getDate()
this.userData.birthKid = selectedDate.getFullYear() + '-' + month + '-' + day
},
handelSave () {
console.log('submit')
......
......@@ -249,10 +249,14 @@ export default {
birthPickerConfirm (date) { // 出生日期控件“确认”事件
const selectedDate = new Date(date)
let month = selectedDate.getMonth() + 1
if (selectedDate.getMonth() + 1 <= 9) {
month = '0' + (selectedDate.getMonth() + 1)
if (month < 10) {
month = '0' + month
}
let day = selectedDate.getDate()
if (day < 10) {
day = '0' + day
}
this.userData.birth = selectedDate.getFullYear() + '-' + month + '-' + selectedDate.getDate()
this.userData.birth = selectedDate.getFullYear() + '-' + month + '-' + day
console.log(date)
},
openPickerLastMensesTime () {
......
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