Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CFFP-HB
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chao Sun
CFFP-HB
Commits
a1a2608e
Commit
a1a2608e
authored
Aug 24, 2023
by
wenyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
3.视频播放统计相关(微信授权登录)
parent
56ed904f
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
68 additions
and
4 deletions
+68
-4
api/api.ts
+4
-1
myPackageA/videoProject/login.vue
+18
-1
myPackageA/videoProject/wxLogin.vue
+39
-0
pages.json
+6
-1
util/interceptor.ts
+1
-1
No files found.
api/api.ts
View file @
a1a2608e
...
@@ -374,7 +374,10 @@ export default {
...
@@ -374,7 +374,10 @@ export default {
// 视频播放轨迹保存
// 视频播放轨迹保存
saveVideoPlayback
(
params
){
saveVideoPlayback
(
params
){
return
request
(
`
${
apiURL
}
/videoPlay/saveVideoPlayback`
,
"POST"
,
params
)
return
request
(
`
${
apiURL
}
/videoPlay/saveVideoPlayback`
,
"POST"
,
params
)
},
//微信认证登录
wxLogin
(
params
){
return
request
(
`
${
cffpURL
}
/user/wxLogin`
,
"POST"
,
params
)
}
}
}
}
myPackageA/videoProject/login.vue
View file @
a1a2608e
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
</view>
</view>
</view>
</view>
<view
class=
"wxLoginBox"
>
<view
class=
"wxLoginBox"
>
<view
class=
"wxLoginLabel"
>
<view
class=
"wxLoginLabel"
@
click=
"getWeChatCode"
>
微信登录
微信登录
</view>
</view>
</view>
</view>
...
@@ -138,6 +138,23 @@
...
@@ -138,6 +138,23 @@
}
}
})
})
}
}
const
getWeChatCode
=
()
=>
{
let
param
=
{
isPayOrAuth
:
'3'
,
fileId
:
videoId
.
value
}
api
.
wxAuthorize
(
param
).
then
((
res
)
=>
{
if
(
res
[
'success'
])
{
window
.
location
.
href
=
res
[
'data'
][
'paymentForm'
][
'action'
];
}
else
{
uni
.
showToast
({
title
:
res
[
'message'
],
duration
:
2000
,
icon
:
'none'
})
}
})
}
const
next
=
()
=>
{
const
next
=
()
=>
{
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
'/myPackageA/videoProject/videoDetail?videoId='
+
videoId
.
value
url
:
'/myPackageA/videoProject/videoDetail?videoId='
+
videoId
.
value
...
...
myPackageA/videoProject/wxLogin.vue
0 → 100644
View file @
a1a2608e
<
template
>
<view
class=
"title"
>
正在微信授权登录
</view>
</
template
>
<
script
lang=
"ts"
setup
>
import
api
from
"@/api/api"
;
import
{
onLoad
}
from
"@dcloudio/uni-app"
;
onLoad
(
option
=>
{
let
param
=
{
code
:
option
.
code
,
state
:
option
.
state
}
api
.
wxLogin
(
param
).
then
((
res
)
=>
{
if
(
res
[
'success'
])
{
uni
.
setStorageSync
(
'cffp_userId'
,
String
(
res
[
'data'
][
'userId'
]));
uni
.
setStorageSync
(
'uni-token'
,
res
[
'data'
][
'token'
]);
uni
.
navigateTo
({
url
:
'/myPackageA/videoProject/videoDetail?videoId='
+
option
.
fileId
})
}
else
{
uni
.
showToast
({
title
:
res
[
'message'
],
duration
:
2000
,
icon
:
'none'
})
uni
.
navigateTo
({
url
:
'/myPackageA/videoProject/login?videoId='
+
option
.
fileId
})
}
})
})
</
script
>
<
style
lang=
"scss"
>
.title
{}
</
style
>
\ No newline at end of file
pages.json
View file @
a1a2608e
...
@@ -482,7 +482,12 @@
...
@@ -482,7 +482,12 @@
},{
},{
"path"
:
"videoProject/videoDetail"
,
"path"
:
"videoProject/videoDetail"
,
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
"法条摘要"
"navigationBarTitleText"
:
"视频播放"
}
},{
"path"
:
"videoProject/wxLogin"
,
"style"
:
{
"navigationBarTitleText"
:
"微信登录"
}
}
}]
}]
}],
}],
...
...
util/interceptor.ts
View file @
a1a2608e
import
{
baseURL
,
apiURL
,
cffpURL
}
from
"../environments/environment"
;
import
{
baseURL
,
apiURL
,
cffpURL
}
from
"../environments/environment"
;
// 白名单,不需要携带token就允许被访问的接口
// 白名单,不需要携带token就允许被访问的接口
const
whiteApiList
=
[
`
${
apiURL
}
/authorize/obtainToken`
,
`
${
apiURL
}
/authorize/checkToken`
,
`
${
cffpURL
}
/user/loginVerification`
,
`
${
apiURL
}
/appVersion/checkIsUpdate`
,
const
whiteApiList
=
[
`
${
apiURL
}
/authorize/obtainToken`
,
`
${
apiURL
}
/authorize/checkToken`
,
`
${
cffpURL
}
/user/loginVerification`
,
`
${
apiURL
}
/appVersion/checkIsUpdate`
,
`
${
cffpURL
}
/accessLog/accessLogSave`
,
`
${
cffpURL
}
/user/powerQuery`
];
`
${
cffpURL
}
/accessLog/accessLogSave`
,
`
${
cffpURL
}
/user/powerQuery`
,
`
${
cffpURL
}
/user/wxLogin`
];
export
const
interceptor
=
()
=>
{
export
const
interceptor
=
()
=>
{
uni
.
addInterceptor
(
'request'
,
{
uni
.
addInterceptor
(
'request'
,
{
...
...
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