Browse Source

下载文件失败的问题修复中...

刘洋 2 years ago
parent
commit
9bc99c4038
4 changed files with 14 additions and 8 deletions
  1. 1 0
      .eslintrc.js
  2. 1 1
      config.json
  3. 6 7
      src/api/api.ts
  4. 6 0
      src/background.ts

+ 1 - 0
.eslintrc.js

@@ -16,5 +16,6 @@ module.exports = {
   rules: {
     "no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
     "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
+    '@typescript-eslint/no-explicit-any':'off'//关闭any类型警告
   },
 };

+ 1 - 1
config.json

@@ -18,7 +18,7 @@
     "logger": {
         "level": "info"
     },
-    "imagemagickDev": "/usr/local/bin/",
+    "imagemagickDev": "C:\\ImageMagick-7.1.0-Q16\\",
     "openDevTools": false,
     "servers": [
         {

+ 6 - 7
src/api/api.ts

@@ -1,11 +1,10 @@
-// @ts-nocheck
 import { httpApp } from "@/plugins/axiosApp";
 
-export function login() {
+export function login(): any {
   return httpApp.get("/api/user/login");
 }
 
-export function getExams(pageNumber: number, pageSize: number) {
+export function getExams(pageNumber: number, pageSize: number): any {
   return httpApp.get(
     "/api/exams?" +
       new URLSearchParams({
@@ -20,8 +19,8 @@ export function getStudents(
   pageNumber: number,
   pageSize: number,
   params: any
-) {
-  const form = {
+): any {
+  const form: any = {
     examId: examId,
     pageNumber: pageNumber,
     pageSize: pageSize,
@@ -36,13 +35,13 @@ export function getStudents(
   return httpApp.post("/api/exam/students", new URLSearchParams(form));
 }
 
-export function countStudents(examId: number, params) {
+export function countStudents(examId: number, params: any) {
   params = params || {};
   params.examId = examId;
   return httpApp.post("/api/exam/students/count", new URLSearchParams(params));
 }
 
-export function getPackages(examId, upload, withUrl) {
+export function getPackages(examId: number, upload: any, withUrl: any) {
   let uri = "/api/package/count/" + examId;
   const param = [];
   if (upload != undefined) {

+ 6 - 0
src/background.ts

@@ -28,6 +28,12 @@ async function createWindow() {
     },
   });
 
+  win.webContents.on("before-input-event", (event, input) => {
+    if (input.key === "F12") {
+      win.webContents.openDevTools();
+    }
+  });
+
   if (process.env.WEBPACK_DEV_SERVER_URL) {
     // Load the url of the dev server if in development mode
     await win.loadURL(process.env.WEBPACK_DEV_SERVER_URL as string);