Explorar o código

ios图片上传闪退测试

LuChongMei hai 9 meses
pai
achega
ff3778215b

+ 19 - 14
src/views/activityMan/placeactivity/placeActivityView.vue

@@ -99,6 +99,7 @@
 
 <script>
 import { ref, onMounted } from "vue";
+import { useStore } from "vuex";
 import personList from "../personList.vue";
 import placeActivityServer from "@/api/placeActivity/placeActivityServer";
 import tools from "@/api/sys/tools";
@@ -113,6 +114,7 @@ import WangEditor from "@/components/editor/WangEditor";
 export default {
   components: { personList, WangEditor },
   setup() {
+	  const store = useStore();
     // 加载
     let isLoading = ref(true);
     // 返回
@@ -299,20 +301,23 @@ export default {
     let fileList = ref([]);
     let fileupList = ref([]);
     const chooseImg = () => {
-      xm.chooseFile({
-        count: 1,
-        name: "file",
-        url: $base + `/sys/file/webupload/upload?uploadPath=reporting/reportingActivities`,
-        headers: { 'Content-Type': 'multipart/form-data', "token": window.localStorage.getItem('MZ_TOKEN') },
-      }).then(res => {
-        let data = res[0].data
-        data.name = decodeURIComponent(
-          data.id.substring(data.url.lastIndexOf("/") + 1)
-        );
-        data.url = $base + data.url;
-        fileupList.value.push(data);
-        fileList.value.push(data)
-      })
+		if (store.state.pctoken != "") {
+			xm.chooseFile({
+			  count: 1,
+			  name: "file",
+			  url: $base + `/sys/file/webupload/upload?uploadPath=reporting/reportingActivities`,
+			  headers: { 'Content-Type': 'multipart/form-data', "token": store.state.pctoken },
+			}).then(res => {
+			  let data = res[0].data
+			  data.name = decodeURIComponent(
+			    data.id.substring(data.url.lastIndexOf("/") + 1)
+			  );
+			  data.url = $base + data.url;
+			  fileupList.value.push(data);
+			  fileList.value.push(data)
+			})
+		}
+      
     }
 
     // 删除文件

+ 2 - 8
src/views/placeManage/placeFirefighting/placeFirefightingView.vue

@@ -352,9 +352,6 @@ export default {
 
     const chooseImg = () => {
       if (store.state.pctoken != "") {
-        xm.showToast({
-          message: store.state.pctoken,
-        });
         // xm.showLoading();
         xm.chooseFile({
           count: 1,
@@ -364,20 +361,17 @@ export default {
             `/sys/file/webupload/upload?uploadPath=religioussites/fire/fireEquipment`,
           headers: {
             "Content-Type": "multipart/form-data",
+			"token": store.state.pctoken,
           },
         }).then((res) => {
-          // "token": token,
+          
           let data = res[0].data;
           data.name = decodeURIComponent(
             data.id.substring(data.url.lastIndexOf("/") + 1)
           );
           data.url = $base + data.url;
-          xm.showToast({
-            message: data.url,
-          });
           fileImg.value.push(data);
           fileList.value.push(data);
-          xm.hideLoading();
         });
       }
     };

+ 0 - 6
src/views/tab_a/tabAll.vue

@@ -265,9 +265,6 @@ export default {
               token: token,
             })
             .then((res) => {
-              xm.showToast({
-                message: res.PcToken,
-              });
               that.$store.commit("setPcToken", res.PcToken);
               that.$store.commit("setUser", res.account);
               that.getBannerImg(); //获取轮播图
@@ -276,9 +273,6 @@ export default {
             });
         }); //上线取消注释
       } else {
-        xm.showToast({
-          message: "222",
-        });
         that.getBannerImg(); //获取轮播图
         that.getSelectColor(); //获取主题颜色
         that.dataNumber(); //获取待办事项数