Browse Source

一些优化

zhangjie 4 năm trước cách đây
mục cha
commit
75f90c8bd3
4 tập tin đã thay đổi với 15 bổ sung4 xóa
  1. 4 0
      README.md
  2. 2 0
      package.json
  3. 8 3
      src/main.js
  4. 1 1
      src/mixins/uploadTaskMixin.js

+ 4 - 0
README.md

@@ -118,3 +118,7 @@ const extraPath =
 - 系统内部预设了一组 config 参数,当根目录`config.json`文件中的参数有缺失时,默认使用预设 config 参数。
 - `input`默认为`/stores/in/`
 - `compressRate`为图片压缩参数,当`compressRate`的值不存在,或者大于 100,或者小于 1 时,默认为 100;实际使用时一般配置 80,此时图片大小会减小约 75%;
+
+## postinstall
+
+- 32/64 切换,`--arch=ia32/x64`

+ 2 - 0
package.json

@@ -2,6 +2,8 @@
   "name": "msyj-client",
   "version": "0.1.0",
   "private": true,
+  "description": "scan client",
+  "author": "chulinice",
   "scripts": {
     "start": "yarn run e:serve",
     "serve": "vue-cli-service serve",

+ 8 - 3
src/main.js

@@ -33,8 +33,11 @@ Vue.prototype.GLOBAL = GLOBAL;
 Vue.config.productionTip = false;
 
 // logger
-const addLog = (datas, type = "success") => {
-  if (type === "success") {
+const addLog = (datas, type) => {
+  if (type === "start") {
+    const msg = `${datas.url},开始请求`;
+    logger.info(msg);
+  } else if (type === "success") {
     const msg = `${datas.config.url},请求成功`;
     logger.info(msg);
   } else {
@@ -71,6 +74,8 @@ axios.interceptors.request.use(
     }
     // 设置延迟时效
     config.timeout = 10 * 60 * 1000;
+
+    addLog(config, "start");
     return config;
   },
   error => {
@@ -87,7 +92,7 @@ axios.interceptors.request.use(
 );
 axios.interceptors.response.use(
   response => {
-    addLog(response);
+    addLog(response, "success");
     // 关闭loading提示
     setTimeout(() => {
       queue.shift();

+ 1 - 1
src/mixins/uploadTaskMixin.js

@@ -50,7 +50,7 @@ export default {
           if (!this.uploadTask) return;
           this.setT = setTimeout(() => {
             this.initUploadTask();
-          }, 5 * 1000);
+          }, 0.5 * 1000);
         },
         uploadErrorCallBack: curUploadTask => {
           const content = `考生:${curUploadTask.studentName},准考证:${curUploadTask.examNumber},科目:${curUploadTask.subjectName},图片上传失败!`;