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

Merge branch 'release/v5.4.0' of Software/android-cloud-H5 into develop

zengzhixiang преди 2 години
родител
ревизия
cc3b794283
променени са 3 файла, в които са добавени 48 реда и са изтрити 34 реда
  1. 1 1
      .env.test
  2. 31 23
      pages/customer-service.vue
  3. 16 10
      plugins/file-center.js

+ 1 - 1
.env.test

@@ -10,7 +10,7 @@ API_URL_BROWSER = "/api"
 FILE_PREFIX = "/"
 FILE_HOST = "file.phone.androidscloud.com"
 FILE_PORT = 8121
-FILE_UPLOAD_KEY = "3dn9b4585511476691c6"
+FILE_UPLOAD_KEY = "13d0arghebcc4cm49cf04"
 FILE_HTTPS = true
 
 # 友盟统计

+ 31 - 23
pages/customer-service.vue

@@ -46,6 +46,36 @@ export default {
     isOnunread() {
       return this.$route.query.onunread === 'true';
     },
+    ysfConfigData() {
+      return [
+        { key: 'real_name', value: this.$auth.user.userName },
+        { key: 'mobile_phone', hidden: true, value: this.$auth.user.phone },
+        { key: 'email', value: this.$auth.user.email },
+        {
+          key: 'avatar',
+          label: '头像',
+          value:
+            this.$auth.user.headImgFileId &&
+            fileKeyToUrl(this.$auth.user.headImgFileId),
+        }, // 访客头像
+        {
+          index: 0,
+          key: 'account',
+          label: '账号',
+          value: this.$auth.user.phone,
+        },
+      ];
+    },
+    ysfConfig() {
+      return {
+        uid: String(this.$auth.user.id),
+        name: this.$auth.user.userName,
+        mobile: this.$auth.user.phone,
+        email: this.$auth.user.email,
+        data: JSON.stringify(this.ysfConfigData),
+        language: 'zh-cn',
+      };
+    },
   },
   mounted() {},
   methods: {
@@ -59,29 +89,7 @@ export default {
 
       await new Promise((resolve, reject) => {
         ysf('config', {
-          uid: String(this.$auth.user.id),
-          name: this.$auth.user.userName,
-          mobile: this.$auth.user.phone,
-          email: this.$auth.user.email,
-          data: JSON.stringify([
-            { key: 'real_name', value: this.$auth.user.userName },
-            { key: 'mobile_phone', hidden: true, value: this.$auth.user.phone },
-            { key: 'email', value: this.$auth.user.email },
-            {
-              key: 'avatar',
-              label: '头像',
-              value:
-                this.$auth.user.headImgFileId &&
-                fileKeyToUrl(this.$auth.user.headImgFileId),
-            }, // 访客头像
-            {
-              index: 0,
-              key: 'account',
-              label: '账号',
-              value: this.$auth.user.phone,
-            },
-          ]),
-          language: 'zh-cn',
+          ...this.ysfConfig,
           success: resolve,
           error: reject,
         });

+ 16 - 10
plugins/file-center.js

@@ -1,15 +1,21 @@
+// import path from 'path';
 import qs from 'qs';
+// import url from 'url';
+
+
+// let baseURL;
+// if (process.env.NODE_ENV === 'development') {
+//   // 开发环境通过本地代理
+//   // baseURL = process.env.FILE_PREFIX;
+//   baseURL = '/file';
+// } else {
+//   // 部署环境通过域名直连
+// }
+const baseURL = `http${process.env.FILE_HTTPS === 'true' ? 's' : ''}://${
+  process.env.FILE_HOST
+}:${process.env.FILE_PORT}/${process.env.FILE_PREFIX}`;
+
 
-let baseURL;
-if (process.env.NODE_ENV === 'development') {
-  // 开发环境通过本地代理
-  baseURL = process.env.FILE_PREFIX;
-} else {
-  // 部署环境通过域名直连
-  baseURL = `http${process.env.FILE_PORT === '443' ? 's' : ''}://${
-    process.env.FILE_HOST
-  }:${process.env.FILE_PORT}/${process.env.FILE_PREFIX}`;
-}
 
 export const fileKeyToUrl = (fileKey, params = {}) =>
   `${baseURL}/document/newFile/download/0/${