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
c8f885be
Commit
c8f885be
authored
Dec 05, 2019
by
潘琦
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
去掉链接中#号,解决部分手机重定向鉴权白板问题;
parent
17b44a31
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
16 deletions
+18
-16
permission.js
src/permission.js
+4
-11
index.js
src/router/index.js
+3
-2
index.vue
src/views/voucherDetail/index.vue
+11
-3
No files found.
src/permission.js
View file @
c8f885be
...
...
@@ -15,15 +15,13 @@ router.beforeEach((to, from, next) => {
let
storecode
=
store
.
getters
.
code
if
(
!
storecode
||
storecode
===
''
)
{
let
params
=
getParamsByUrl
(
window
.
location
.
href
)
if
(
params
.
code
)
{
if
(
params
.
code
&&
params
.
code
!==
'undefined'
)
{
store
.
dispatch
(
'setCode'
,
params
.
code
)
getOauthFn
(()
=>
{
next
()
})
}
else
{
getWXOauth
(()
=>
{
next
()
})
getWXOauth
()
}
}
else
{
next
()
...
...
@@ -57,7 +55,7 @@ router.beforeEach((to, from, next) => {
// store.dispatch('setToken', '490cd9b7-dca7-4cc3-87e9-5eacbb5a5d77')
})
let
getWXOauth
=
(
callback
)
=>
{
let
getWXOauth
=
()
=>
{
let
url
=
removeUrlParam
(
'code'
)
// store.dispatch('setCode', '')
let
authId
=
''
...
...
@@ -65,13 +63,8 @@ let getWXOauth = (callback) => {
authId
=
'&auth_id='
+
getParamsByUrl
(
window
.
location
.
href
).
auth_id
store
.
dispatch
(
'setAuthId'
,
getParamsByUrl
(
window
.
location
.
href
).
auth_id
)
}
// window.location.reload(defaultUrl + '/wxoauth/route?redirect_uri=' + encodeURIComponent(url) + authId + '&auth_scene=voucher&v=' + timeStamp)
window
.
location
.
href
=
defaultUrl
+
'/wxoauth/route?redirect_uri='
+
encodeURIComponent
(
url
)
+
authId
+
'&auth_scene=voucher'
const
u
=
navigator
.
userAgent
const
isAndroid
=
u
.
indexOf
(
'Android'
)
>
-
1
||
u
.
indexOf
(
'Linux'
)
>
-
1
// g
// const isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/) // ios终端
if
(
isAndroid
)
{
callback
()
}
}
let
getOauthFn
=
(
callback
)
=>
{
...
...
src/router/index.js
View file @
c8f885be
...
...
@@ -4,6 +4,8 @@ import Router from 'vue-router'
Vue
.
use
(
Router
)
export
default
new
Router
({
mode
:
'history'
,
base
:
'/voucher/'
,
routes
:
[
{
path
:
'/'
,
...
...
@@ -145,6 +147,5 @@ export default new Router({
}
]
}
],
base
:
'/voucher/'
]
})
src/views/voucherDetail/index.vue
View file @
c8f885be
...
...
@@ -272,9 +272,17 @@ export default {
getTipsByVoucherId
(
this
.
voucherId
).
then
(
res
=>
{
this
.
$Indicator
.
close
()
if
(
res
&&
res
.
msg
===
'success'
)
{
this
.
tipsPopupVisible
=
true
this
.
tipsData
=
res
.
data
this
.
tipsData
.
tipsDetailed
=
this
.
tipsData
.
tipsDetailed
.
replace
(
/
[\r\n]
/g
,
'<br>'
)
if
(
res
.
data
)
{
this
.
tipsPopupVisible
=
true
this
.
tipsData
=
res
.
data
this
.
tipsData
.
tipsDetailed
=
this
.
tipsData
.
tipsDetailed
.
replace
(
/
[\r\n]
/g
,
'<br>'
)
}
else
{
this
.
$toast
({
message
:
'该服务券还没有小贴士噢!'
,
position
:
'center'
,
duration
:
3000
})
}
}
else
{
this
.
$toast
({
message
:
'该服务券还没有小贴士噢!'
,
...
...
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