Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
ydl-group-course
Overview
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
黄志
ydl-group-course
Commits
065ea30c
Commit
065ea30c
authored
Apr 05, 2023
by
huangzhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 给需要设置cookie的页面加needSetToken 标识
parent
05760d22
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
0 deletions
+66
-0
my.vue
src/pages/my/my.vue
+7
-0
web.vue
src/pages/web/web.vue
+59
-0
No files found.
src/pages/my/my.vue
View file @
065ea30c
...
@@ -123,6 +123,13 @@ export default {
...
@@ -123,6 +123,13 @@ export default {
logoutVisible
:
false
,
logoutVisible
:
false
,
}
}
},
},
// // 分享给朋友
// onShareAppMessage() {
// return {
// title: `壹点灵心理学课程`,
// path: `/pages/my/my`,
// }
// },
computed
:
{
computed
:
{
// 用户基本信息
// 用户基本信息
userInfo
()
{
userInfo
()
{
...
...
src/pages/web/web.vue
View file @
065ea30c
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
<
script
>
<
script
>
import
{
hostPrefix
}
from
'@/config.js'
import
{
hostPrefix
}
from
'@/config.js'
import
{
ffrom
}
from
'@/utils/enums'
import
{
ffrom
}
from
'@/utils/enums'
import
qs
from
'qs'
export
default
{
export
default
{
name
:
'WebPage'
,
name
:
'WebPage'
,
...
@@ -45,6 +46,61 @@ export default {
...
@@ -45,6 +46,61 @@ export default {
onUnload
()
{
onUnload
()
{
uni
.
$off
(
'loginSuccess'
,
this
.
handleLoginSuccess
)
uni
.
$off
(
'loginSuccess'
,
this
.
handleLoginSuccess
)
},
},
// // 分享给朋友
// onShareAppMessage() {
// const getSuccessPageUrl = _pagePath => {
// const pageParams = {
// uid: this.$store.state.user.uid || '',
// isFromMin: 'weapp',
// courseId: this.courseId,
// groupRecordId: this.groupRecordId,
// }
// const urlStr = qs.stringify(pageParams)
// let url = `${hostPrefix}/h5-course/${_pagePath}?${urlStr}`
// url = `/pages/web/web?title=${'支付成功'}&loadUrl=${encodeURIComponent(url)}`
// return url
// }
// const getDetailPageUrl = () => {
// let url = this.loadUrl
// // 分享页面,去掉登陆信息
// const query = {
// accessToken: '',
// uid: '',
// timestamp: +new Date(),
// }
// // 更新 url 中的参数
// Object.keys(query).forEach(prop => {
// url = this.changeURLArg(this.loadUrl, prop, query[prop])
// })
// url = `/pages/web/web?loadUrl=${encodeURIComponent(url)}`
// return url
// }
// // 支付成功详情页面
// if (this.loadUrl.includes('pay/groupSuccess')) {
// return {
// title: `支付成功详情`,
// path: getSuccessPageUrl('pay/groupSuccess'),
// }
// }
// if (this.loadUrl.includes('pay/success')) {
// return {
// title: `支付成功详情`,
// path: getSuccessPageUrl('pay/success'),
// }
// }
// if (this.loadUrl.includes('h5-course/detail')) {
// return {
// title: `课程详情`,
// path: getDetailPageUrl(),
// }
// }
// // return {}
// },
mounted
()
{
mounted
()
{
// this.options.scene 无值,说明是非扫描二维码,此时自己拼装路径
// this.options.scene 无值,说明是非扫描二维码,此时自己拼装路径
if
(
!
this
.
options
.
scene
)
{
if
(
!
this
.
options
.
scene
)
{
...
@@ -126,6 +182,9 @@ export default {
...
@@ -126,6 +182,9 @@ export default {
}
}
return
acc
return
acc
},
{})
},
{})
// 课程详情页面,给一个设置cookie,这样h5工程路由中间件中,获取这个标识后,
// 根据页面地址是否有 uid accessToken 进行cookie设置
params
.
needSetToken
=
true
this
.
loadUrl
=
this
.
setCommonUrlParams
(
`
${
url
}
`
,
params
)
this
.
loadUrl
=
this
.
setCommonUrlParams
(
`
${
url
}
`
,
params
)
console
.
log
(
res
,
'二维码参数解析'
)
console
.
log
(
res
,
'二维码参数解析'
)
uni
.
hideLoading
()
uni
.
hideLoading
()
...
...
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