Browse Source

Merge branch 'dev/v1.1.13.1_wmh' of jianyu/web into hotfix/v1.1.13.1

wenmenghao 3 weeks ago
parent
commit
88827965a1

+ 9 - 1
apps/mobile/src/api/modules/message.js

@@ -217,7 +217,15 @@ export function ajaxMessageOpenLog(data) {
 export function materialDetail(data) {
   // data = qs.stringify(data)
   return request({
-    url: '/jyapi/messageCenter/materialDetail',
+    url: 'jyapi/messageCenter/materialDetail',
+    method: 'post',
+    data
+  })
+}
+export function fileDownload(data) {
+  data = qs.stringify(data)
+  return request({
+    url: '/material/fileDownload',
     method: 'post',
     data
   })

+ 18 - 12
apps/mobile/src/views/message/materialDetail.vue

@@ -44,7 +44,7 @@
 
 <script>
 import dayjs from 'dayjs'
-import { materialDetail } from '@/api/modules'
+import { fileDownload, materialDetail } from '@/api/modules'
 import { copyText } from '@/utils'
 import { savePic } from '@/utils/callFn/appFn'
 
@@ -102,18 +102,24 @@ export default {
       this.saveEvent(link)
     },
 
-    saveEvent(url) {
+    async saveEvent(url) {
       if (this.$env.platform === 'app') {
-        try {
-          savePic(
-            url,
-            '剑鱼标讯需要您的存储权限,将用于保存图片到本地。'
-          )
-          this.$toast('保存图片成功')
-        }
-        catch (e) {
-          console.log(e)
-          this.$toast('保存图片失败')
+        const loading = this.$toast.loading()
+        const { imgBase } = await fileDownload({ ossUrl: url })
+        if (imgBase) {
+          loading.clear()
+          const base64img = imgBase.split('base64,')[1]
+          try {
+            savePic(
+              base64img,
+              '剑鱼标讯需要您的存储权限,将用于保存图片到本地。'
+            )
+            this.$toast('保存图片成功')
+          }
+          catch (e) {
+            console.log(e)
+            this.$toast('保存图片失败')
+          }
         }
       }
       else { // 微信