|
@@ -40,15 +40,26 @@
|
|
|
data: {},
|
|
|
})
|
|
|
if (res.data.success) {
|
|
|
+ const curryUrl = this.curry("/hybrid/html/web/viewer.html?file=")
|
|
|
if (this.type == '1') { //使用协议
|
|
|
- this.url = "/hybrid/html/web/viewer.html?file="+res.data.single.userUseProtocol;
|
|
|
+ this.url = curryUrl(res.data.single.userUseProtocol);
|
|
|
} else if (this.type == '2') { //隐私协议
|
|
|
- this.url = "/hybrid/html/web/viewer.html?file="+res.data.single.userPrivacyProtocol;
|
|
|
+ this.url = curryUrl(res.data.single.userPrivacyProtocol);
|
|
|
} else if (this.type == '3') { //业主注册协议
|
|
|
- this.url = "/hybrid/html/web/viewer.html?file="+res.data.single.ownerRegistProtocol;
|
|
|
+ this.url = curryUrl(res.data.single.ownerRegistProtocol);
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ curry(baseUrl){
|
|
|
+ return function(url){
|
|
|
+ let index = url.lastIndexOf('.');
|
|
|
+ if(url.substring(index+1).indexOf('pdf')>-1){
|
|
|
+ return baseUrl+url;
|
|
|
+ }else{
|
|
|
+ return url;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|