Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
voucher-h5
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
潘琦
voucher-h5
Commits
9bce7d2c
Commit
9bce7d2c
authored
Sep 05, 2019
by
潘琦
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、解决微信分享出去链接被篡改问题;2、添加家庭成员,子女出生年月日;
parent
007b4941
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
8 deletions
+45
-8
index.js
config/index.js
+1
-2
permission.js
src/permission.js
+30
-0
addMember.vue
src/views/member/addMember.vue
+7
-3
edit.vue
src/views/member/edit.vue
+7
-3
No files found.
config/index.js
View file @
9bce7d2c
...
...
@@ -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' // 机构空间(正式)
...
...
src/permission.js
View file @
9bce7d2c
...
...
@@ -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) {
...
...
src/views/member/addMember.vue
View file @
9bce7d2c
...
...
@@ -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'
)
...
...
src/views/member/edit.vue
View file @
9bce7d2c
...
...
@@ -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
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment