|
@@ -3,10 +3,8 @@
|
|
|
* Copyright (c) 2019 ruoyi
|
|
|
*/
|
|
|
|
|
|
+let Base64 = require('js-base64').Base64;
|
|
|
// 判断当前用户网络 外网/内网 返回接口地址
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
export function judgmentNetworkReturnAddress() {
|
|
|
/*判断是否是内网IP*/
|
|
|
// 获取当前页面url
|
|
@@ -309,29 +307,8 @@ export function spaceJudgmentHTML(rule, value, callback) {
|
|
|
* 预览地址判断
|
|
|
*/
|
|
|
export function urlJudge(url) {
|
|
|
- // let src = '';
|
|
|
- // url = '/admin/statics'+url.split('statics')[1]
|
|
|
- url = '/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)
|
|
|
- }
|
|
|
- // 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]+'://' +judgmentNetworkReturnAddress() +'/admin/'+ url))));
|
|
|
- // }
|
|
|
- console.log('location',location);
|
|
|
- console.log('url',url);
|
|
|
- return location + url
|
|
|
+ let src = window.location.href.split('://')[0]+'://' + judgmentNetworkReturnAddress()+'/statics'+ url.split('statics')[1]
|
|
|
+ return localStorage.getItem('filePreviewUrl')+'/onlinePreview?url='+encodeURIComponent(btoa(unescape(encodeURIComponent(src))));
|
|
|
}
|
|
|
|
|
|
/**
|