Ver Fonte

conflict fiex

zhangjie há 4 anos atrás
pai
commit
60707d6e15

+ 1 - 0
.env.development

@@ -1 +1,2 @@
+VUE_APP_SELF_DEFINE_DOMAIN=true
 VUE_APP_ENABLE_VUE_RENDER_LOGS=false

+ 1 - 1
.eslintrc.js

@@ -8,7 +8,7 @@ module.exports = {
     parser: "babel-eslint",
   },
   rules: {
-    "no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
+    "no-console": process.env.NODE_ENV === "production" ? "off" : "off",
     "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
   },
   overrides: [

+ 3 - 1
http-test/user.http

@@ -23,5 +23,7 @@ time: 0
 }
 
 
-
+### test origin
+GET http://qmth.oss-cn-shenzhen.aliyuncs.com/file/2020/8/31/87238cea138f4cf6a99df1a8399a6bb0.txt
+Origin: http://test1.qm.com:9222
 

+ 5 - 5
prebuild.js

@@ -1,9 +1,9 @@
-const packageJson = require("./package.json");
+// const packageJson = require("./package.json");
 
-if (packageJson.dependencies.iview !== "^3.4.1") {
-  console.log("iview 的版本不要轻易升级,一定要充分测试。");
-  process.exit(1);
-}
+// if (packageJson.dependencies.iview !== "^3.4.1") {
+//   console.log("iview 的版本不要轻易升级,一定要充分测试。");
+//   process.exit(1);
+// }
 
 console.log("> prebuild");
 console.log("> prebuild create .env.production.local");

+ 8 - 4
src/api/examwork-exam.js

@@ -5,10 +5,14 @@ import { object2QueryString } from "@/utils/utils";
 export function searchExams({
   name = "",
   enable = "",
+  mode = "",
   pageNumber = 1,
   pageSize = 10,
 }) {
-  const data = pickBy({ name, enable, pageNumber, pageSize }, (v) => v !== "");
+  const data = pickBy(
+    { name, enable, mode, pageNumber, pageSize },
+    (v) => v !== ""
+  );
   return httpApp.post("/api/admin/exam/query?" + object2QueryString(data));
 }
 
@@ -32,7 +36,7 @@ export function saveExam({
   code = "",
   createId = 0,
   createTime = "",
-  enable = 0,
+  enable = "",
   enableIpLimit = 0,
   endTime = "",
   entryAuthenticationPolicy = "",
@@ -40,7 +44,7 @@ export function saveExam({
   forceFinish = 0,
   inProcessFaceStrangerIgnore = 0,
   inProcessFaceVerify = 0,
-  inProcessLivenessFixedRange = "",
+  inProcessLivenessFixedRange = [],
   inProcessLivenessJudgePolicy = "",
   inProcessLivenessVerify = 0,
   ipAllow = "",
@@ -48,7 +52,7 @@ export function saveExam({
   minDurationSeconds = 0,
   mode = "",
   monitorRecord = 0,
-  monitorVideoSource = [""],
+  monitorVideoSource = [],
   name = "",
   objectiveScorePolicy = "",
   openingSeconds = 0,

+ 7 - 3
src/constant/constants.js

@@ -6,9 +6,6 @@ if (!localStorage.getItem("deviceId")) {
 }
 export const DEVICE_ID = localStorage.getItem("deviceId");
 
-export const ORG_CODE =
-  process.env.VUE_APP_ORG_CODE || window.location.hostname.split(".")[0];
-
 export const INVIGILATOR_IMPORT_TEMPLATE_DOWNLOAD_URL =
   "/file/考场监考老师导入.xlsx";
 export const EXAM_STUDENT_IMPORT_TEMPLATE_DOWNLOAD_URL =
@@ -41,3 +38,10 @@ export const REEXAM_REASON = {
   BREAK_TIME_OUT: "断点续考次数用完",
   INVIGILATE_MISS: "监考人员误操作",
 };
+
+let domain;
+if (process.env.VUE_APP_SELF_DEFINE_DOMAIN === "true") {
+  domain = window.localStorage.getItem("domain_in_url");
+}
+if (!domain) domain = window.location.hostname.split(".")[0];
+export const ORG_CODE = domain;

+ 1 - 1
src/features/Login/Login.vue

@@ -119,7 +119,7 @@ export default {
             await this.$store.dispatch(LOGIN_BY_USERNAME, {
               loginName: this.user.username,
               password: this.user.password,
-              code: "test1",
+              code: ORG_CODE,
             });
             // console.log(res);
             // localStorage.setItem("themis-user", res.data);

+ 8 - 5
src/features/examwork/ExamManagement/ExamEdit.vue

@@ -192,7 +192,7 @@
                 </el-radio>
                 <el-radio
                   v-model="form.entryAuthenticationPolicy"
-                  label="LIVENESS"
+                  label="LIVENESS_VERIFY"
                 >
                   安全级别:<span style="color: #1cd1a1; font-size: 20px;">
@@ -244,9 +244,9 @@
                 v-model.trim="form.inProcessLivenessFixedRange[1]"
                 style="width: 150px;"
               />
-              <span style="color: red;"
-                >*活体验证将该时间段内随机出现,且时间段设置不能超过冻结时间</span
-              >
+              <span style="color: red;">
+                *活体验证将该时间段内随机出现,且时间段设置不能超过冻结时间
+              </span>
             </el-form-item>
           </el-row>
           <el-row v-if="form.inProcessLivenessVerify">
@@ -398,6 +398,9 @@ export default {
     if (this.isEdit) {
       const res = await getExamDetail({ id: this.examId });
       this.form = { ...this.form, ...res.data.data };
+      if (!this.form.inProcessLivenessFixedRange) {
+        this.form.inProcessLivenessFixedRange = [0, 0];
+      }
       this.form.startEndTimeProxy = [this.form.startTime, this.form.endTime];
       this.form.monitorProxy = !!this.form.monitorVideoSource;
     }
@@ -432,7 +435,7 @@ export default {
         inProcessFaceVerify: 0,
         inProcessFaceStrangerIgnore: 0,
         inProcessLivenessVerify: 0,
-        inProcessLivenessFixedRange: [],
+        inProcessLivenessFixedRange: [0, 0],
         inProcessLivenessJudgePolicy: "ALL",
         monitorProxy: false,
         monitorRecord: 0,

+ 1 - 0
src/features/examwork/ExamManagement/ExamManagement.vue

@@ -158,6 +158,7 @@ export default {
       const res = await searchExams({
         enable: this.form.enableState,
         name: this.form.name,
+        mode: this.form.mode,
         pageNumber: this.currentPage,
         pageSize: this.pageSize,
       });

+ 20 - 3
src/utils/utils.js

@@ -41,14 +41,31 @@ export function object2QueryString(obj) {
   return queryString.stringify(obj);
 }
 
+function toDataURL(url) {
+  return fetch(url)
+    .then((response) => {
+      return response.blob();
+    })
+    .then((blob) => {
+      return URL.createObjectURL(blob);
+    });
+}
+
 // 下载文件
-export function downloadFileURL(url, name) {
+export async function downloadFileURL(url, name) {
   const link = document.createElement("a");
   link.style.display = "none";
-  // txt 文件会直接在浏览器里面打开,这时候只能修改服务器设置,加上 Content-Disposition: attachment
-  link.href = url;
   const fileName = name || url.split("/").pop();
   link.setAttribute("download", fileName);
+
+  // txt 文件会直接在浏览器里面打开,这时候只能修改服务器设置,加上 Content-Disposition: attachment
+  if ([".txt"].some((v) => fileName.endsWith(v))) {
+    // const urlObj = new URL(url);
+    // link.href = await toDataURL(url.replace(urlObj.origin));
+    link.href = await toDataURL(url);
+  } else {
+    link.href = url;
+  }
   document.body.appendChild(link);
   link.click();
   document.body.removeChild(link);

+ 5 - 0
vue.config.js

@@ -4,6 +4,11 @@ let proxy = {
     // target: "http://192.168.10.86:6001/",
     changeOrigin: true,
   },
+  "/file": {
+    target: "http://192.168.10.36:6001/",
+    // target: "http://192.168.10.86:6001/",
+    changeOrigin: true,
+  },
 };
 
 var webpack = require("webpack");