dedsudiyu 2 år sedan
förälder
incheckning
f38d5e9460
2 ändrade filer med 35 tillägg och 23 borttagningar
  1. 19 7
      src/utils/ruoyi.js
  2. 16 16
      src/views/system/apkfile/index.vue

+ 19 - 7
src/utils/ruoyi.js

@@ -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
 }

+ 16 - 16
src/views/system/apkfile/index.vue

@@ -207,22 +207,22 @@
 
 
 
-                  <el-form-item label="安装包" prop="apkFileUpload" label-width="90px">
-                    <el-upload
-                      style="margin:0 auto;width:120px;"
-                      class="avatar-uploader"
-                      :action="uploadImgUrl"
-                      accept="application/vnd.android.package-archive"
-                      :show-file-list="false"
-                      :on-progress="progressUp"
-                      :on-success="handleAvatarSuccess"
-                      :on-error="errorUp"
-                      :headers="headers"
-                      :before-upload="beforeAvatarUpload">
-                      <img v-if="upForm.apkFileUpload" src="@/assets/ZDimages/icon_apk.png">
-                      <i v-if="!upForm.apkFileUpload" class="el-icon-plus avatar-uploader-icon" style="height:40px;line-height:40px;width:40px;text-align: center"></i>
-                    </el-upload>
-                  </el-form-item>
+            <el-form-item label="安装包" prop="apkFileUpload" label-width="90px">
+              <el-upload
+                style="margin:0 auto;width:120px;"
+                class="avatar-uploader"
+                :action="uploadImgUrl"
+                accept="application/vnd.android.package-archive"
+                :show-file-list="false"
+                :on-progress="progressUp"
+                :on-success="handleAvatarSuccess"
+                :on-error="errorUp"
+                :headers="headers"
+                :before-upload="beforeAvatarUpload">
+                <img v-if="upForm.apkFileUpload" src="@/assets/ZDimages/icon_apk.png">
+                <i v-if="!upForm.apkFileUpload" class="el-icon-plus avatar-uploader-icon" style="height:40px;line-height:40px;width:40px;text-align: center"></i>
+              </el-upload>
+            </el-form-item>
         </el-form>
       </div>
       <div slot="footer" class="dialog-footer">