|
@@ -121,24 +121,25 @@ export default {
|
|
|
|
|
|
//授权验证
|
|
|
initViewer() {
|
|
|
- const that = this;
|
|
|
- // console.log("session获取id",that.generateUUID())
|
|
|
- // console.log("时间戳",that.getCurrentTimestamp())
|
|
|
- DataFunc.post('/uvp-backend-common/api/v1/authorization', {
|
|
|
- ak: that.cameraConfig.ak,
|
|
|
- sk: that.cameraConfig.sk
|
|
|
- },{location: true}).then(res => {
|
|
|
- console.log("==获取的授权信息==",res);
|
|
|
- if(res && res.resultValue){
|
|
|
- that.cameraConfig.token = res.resultValue.token;
|
|
|
- //that.props.onLoad && that.props.onLoad(that);
|
|
|
- //加载播放器
|
|
|
- this.$emit("videoLoad", this);
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
+ const that = this;
|
|
|
+ let apiUrl = '/uvp-backend-common/api/v1/authorization';
|
|
|
+ if (apiUrl.startsWith('/sxgw')) {
|
|
|
+ apiUrl = apiUrl.substring(4);
|
|
|
+ }
|
|
|
+ DataFunc.post(apiUrl, {
|
|
|
+ ak: that.cameraConfig.ak,
|
|
|
+ sk: that.cameraConfig.sk
|
|
|
+ }, { location: true }).then(res => {
|
|
|
+ console.log("==获取的授权信息==", res);
|
|
|
+ if (res && res.resultValue) {
|
|
|
+ that.cameraConfig.token = res.resultValue.token;
|
|
|
+ // 加载播放器
|
|
|
+ this.$emit("videoLoad", this);
|
|
|
+ }
|
|
|
+ }).catch(error => {
|
|
|
+ console.error("请求失败:", error);
|
|
|
+ });
|
|
|
+},
|
|
|
|
|
|
//开始播放
|
|
|
videoPlay(options) {
|