Преглед на файлове

Merge branch 'master' of http://git.huihenduo.com.cn:3000/wzh/JiangYunPhotosCargoOwner_WebApp into wuchan

wzh преди 3 години
родител
ревизия
8af48148cb
променени са 3 файла, в които са добавени 16 реда и са изтрити 8 реда
  1. 7 4
      src/apis/cloudLogin.js
  2. 7 2
      src/components/Header.vue
  3. 2 2
      src/views/voyage/voyageDetail.vue

+ 7 - 4
src/apis/cloudLogin.js

@@ -9,8 +9,11 @@ const auth = tcb.auth({
 });
 
 async function AnonymousLogin() {
-  await auth.anonymousAuthProvider().signIn();
-  const loginState = await auth.getLoginState();
+  return new Promise(async (resolve, reject) => {
+    let signIn = await auth.anonymousAuthProvider().signIn();
+    const loginState = await auth.getLoginState();
+    resolve();
+  });
 }
-AnonymousLogin();
-export default tcb;
+
+export { AnonymousLogin, tcb };

+ 7 - 2
src/components/Header.vue

@@ -47,7 +47,7 @@
 import store from "../store";
 import router from "../router";
 import { onMounted, ref } from "vue";
-import tcb from "../apis/cloudLogin";
+import { AnonymousLogin, tcb } from "../apis/cloudLogin";
 const db = tcb.database();
 const v = db.collection("huihenduo_versions");
 const __ = db.command;
@@ -98,7 +98,7 @@ export default {
     let timelineData = ref([]);
     // timelineData.value = vs.reverse();
     onMounted(() => {
-      getAbledVersions();
+      cloudLogin();
     });
     async function getAbledVersions() {
       let res = await v
@@ -107,6 +107,11 @@ export default {
         .get();
       timelineData.value = res.data.reverse();
     }
+
+    async function cloudLogin() {
+      await AnonymousLogin();
+      getAbledVersions();
+    }
     return {
       quit,
       contactName,

+ 2 - 2
src/views/voyage/voyageDetail.vue

@@ -697,10 +697,10 @@
         </div>
       </div>
     </div>
-    <el-dialog v-model="mediaModal" :title="modalTitle" width="20%">
+    <el-dialog v-model="mediaModal" :title="modalTitle">
       <el-image
         v-if="modalType == 1"
-        style="width: 100%; height: 100%"
+        style="max-width: 80vw; max-height: 60vh; display: flex"
         fit="contain"
         :src="currentUrl"
         :preview-src-list="modalPreview"