Commit a1a2608e by wenyang

3.视频播放统计相关(微信授权登录)

parent 56ed904f
......@@ -374,7 +374,10 @@ export default {
// 视频播放轨迹保存
saveVideoPlayback(params){
return request(`${apiURL}/videoPlay/saveVideoPlayback`, "POST", params)
},
//微信认证登录
wxLogin(params){
return request(`${cffpURL}/user/wxLogin`, "POST", params)
}
}
......@@ -33,7 +33,7 @@
</view>
</view>
<view class="wxLoginBox">
<view class="wxLoginLabel">
<view class="wxLoginLabel" @click="getWeChatCode">
微信登录
</view>
</view>
......@@ -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 = ()=>{
uni.navigateTo({
url:'/myPackageA/videoProject/videoDetail?videoId='+videoId.value
......
<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
......@@ -482,7 +482,12 @@
},{
"path": "videoProject/videoDetail",
"style": {
"navigationBarTitleText": "法条摘要"
"navigationBarTitleText": "视频播放"
}
},{
"path": "videoProject/wxLogin",
"style": {
"navigationBarTitleText": "微信登录"
}
}]
}],
......
import {baseURL,apiURL,cffpURL} from "../environments/environment";
// 白名单,不需要携带token就允许被访问的接口
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 = () => {
uni.addInterceptor('request', {
......
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