|
@@ -251,12 +251,24 @@ export function spaceJudgmentHTML(rule, value, callback) {
|
|
|
* 预览地址判断
|
|
|
*/
|
|
|
export function urlJudge(url) {
|
|
|
- let src = '';
|
|
|
- if(url.indexOf('http') !== -1){
|
|
|
- let text = window.location.href.split('://')[0]+'://' + url.split('://')[1]
|
|
|
- src = localStorage.getItem('filePreviewUrl') + '/onlinePreview?url='+encodeURIComponent(btoa(unescape(encodeURIComponent(text))));
|
|
|
- }else{
|
|
|
- src = localStorage.getItem('filePreviewUrl') + '/onlinePreview?url='+encodeURIComponent(btoa(unescape(encodeURIComponent(window.location.href.split('://')[0]+'://' +process.env.VUE_APP_BASE_API +'/admin/'+ url))));
|
|
|
+ // let src = '';
|
|
|
+ url = '/admin/statics'+url.split('statics')[1]
|
|
|
+ // console.log('url',url);
|
|
|
+ let location = window.location.href
|
|
|
+ // console.log('location',location)
|
|
|
+ if (location.indexOf('?#/') !== -1){
|
|
|
+ location = location.split('?#/')[0]
|
|
|
+ // console.log('location1',location)
|
|
|
+ }else if(location.indexOf('/#/') !== -1){
|
|
|
+ location = location.split('/#/')[0]
|
|
|
+ // console.log('location2',location)
|
|
|
}
|
|
|
- return src
|
|
|
+ // console.log('src',src)
|
|
|
+ // if(url.indexOf('http') !== -1){
|
|
|
+ // let text = window.location.href.split('://')[0]+'://' + url.split('://')[1]
|
|
|
+ // src = localStorage.getItem('filePreviewUrl') + '/onlinePreview?url='+encodeURIComponent(btoa(unescape(encodeURIComponent(text))));
|
|
|
+ // }else{
|
|
|
+ // src = localStorage.getItem('filePreviewUrl') + '/onlinePreview?url='+encodeURIComponent(btoa(unescape(encodeURIComponent(window.location.href.split('://')[0]+'://' +process.env.VUE_APP_BASE_API +'/admin/'+ url))));
|
|
|
+ // }
|
|
|
+ return location + url
|
|
|
}
|