allen 2 mēneši atpakaļ
vecāks
revīzija
9b3f30f864

+ 50 - 16
ips-admin/src/main/java/com/ips/system/utils/AlgorithmCaller.java

@@ -19,21 +19,21 @@ public class AlgorithmCaller {
 
     /**
      * 获取算法的根目录
-     * @param pythonFilePath Python文件的完整路径,如"d:/xxx/yyy/zzz/dd.py"
+     * @param filePath 文件的完整路径,如"d:/xxx/yyy/zzz/dd.py" 或 "d:/xxx/yyy/zzz/program.exe"
      * @return 返回根目录路径,如"d:/xxx/yyy/zzz/"
      */
-    public static String getAlgorithmRootPath(String pythonFilePath) {
-        if (pythonFilePath == null || pythonFilePath.isEmpty()) {
-            throw new IllegalArgumentException("Python file path cannot be null or empty");
+    public static String getAlgorithmRootPath(String filePath) {
+        if (filePath == null || filePath.isEmpty()) {
+            throw new IllegalArgumentException("File path cannot be null or empty");
         }
 
-        Path path = Paths.get(pythonFilePath);
+        Path path = Paths.get(filePath);
         Path parentPath = path.getParent();
 
         if (parentPath != null) {
             return parentPath.toString() + File.separator;
         } else {
-            throw new IllegalArgumentException("Invalid python file path: " + pythonFilePath);
+            throw new IllegalArgumentException("Invalid file path: " + filePath);
         }
     }
 
@@ -74,7 +74,7 @@ public class AlgorithmCaller {
      * 调用Python代码
      * @param pythonScriptPath Python脚本路径
      * @param workingDirectory 工作目录
-     * @return 执行成功返回"成功",失败返回错误信息
+     * @return 执行成功返回空字符串,失败返回错误信息
      */
     public static String callPythonScript(String pythonScriptPath, String workingDirectory) {
         if (pythonScriptPath == null || pythonScriptPath.isEmpty()) {
@@ -85,6 +85,34 @@ public class AlgorithmCaller {
         processBuilder.directory(new File(workingDirectory));
         processBuilder.redirectErrorStream(true);
 
+        return executeProcess(processBuilder, pythonScriptPath);
+    }
+
+    /**
+     * 调用EXE程序
+     * @param exePath EXE程序路径
+     * @param workingDirectory 工作目录
+     * @return 执行成功返回空字符串,失败返回错误信息
+     */
+    public static String callExeProgram(String exePath, String workingDirectory) {
+        if (exePath == null || exePath.isEmpty()) {
+            throw new IllegalArgumentException("EXE path cannot be null or empty");
+        }
+
+        ProcessBuilder processBuilder = new ProcessBuilder(exePath);
+        processBuilder.directory(new File(workingDirectory));
+        processBuilder.redirectErrorStream(true);
+
+        return executeProcess(processBuilder, exePath);
+    }
+
+    /**
+     * 执行进程并处理输出
+     * @param processBuilder 进程构建器
+     * @param programPath 程序路径(用于日志记录)
+     * @return 执行结果
+     */
+    private static String executeProcess(ProcessBuilder processBuilder, String programPath) {
         try {
             Process process = processBuilder.start();
 
@@ -102,17 +130,17 @@ public class AlgorithmCaller {
             int exitCode = process.waitFor();
 
             if (exitCode == 0) {
-                logger.info("Python script executed successfully: {}", pythonScriptPath);
+                logger.info("Program executed successfully: {}", programPath);
                 return "";
             } else {
-                String errorMsg = String.format("Python script execution failed with exit code %d. Output: %s",
+                String errorMsg = String.format("Program execution failed with exit code %d. Output: %s",
                         exitCode, output.toString());
                 logger.error(errorMsg);
                 return errorMsg;
             }
         } catch (IOException | InterruptedException e) {
-            String errorMsg = String.format("Failed to execute Python script: %s. Error: %s",
-                    pythonScriptPath, e.getMessage());
+            String errorMsg = String.format("Failed to execute program: %s. Error: %s",
+                    programPath, e.getMessage());
             logger.error(errorMsg, e);
             return errorMsg;
         }
@@ -120,20 +148,26 @@ public class AlgorithmCaller {
 
     /**
      * 完整调用流程
-     * @param pythonScriptPath Python脚本路径
+     * @param programPath 程序路径(可以是.py或.exe)
      * @param jsonContent 输入JSON内容
      * @return 执行结果
      */
-    public static String executeAlgorithm(String pythonScriptPath, String jsonContent) {
+    public static String executeAlgorithm(String programPath, String jsonContent) {
         try {
             // 1. 获取工作目录
-            String workingDirectory = getAlgorithmRootPath(pythonScriptPath);
+            String workingDirectory = getAlgorithmRootPath(programPath);
 
             // 2. 生成输入文件
             generateInputJsonFile(workingDirectory, jsonContent);
 
-            // 3. 调用Python脚本
-            return callPythonScript(pythonScriptPath, workingDirectory);
+            // 3. 根据文件类型调用相应程序
+            if (programPath.toLowerCase().endsWith(".py")) {
+                return callPythonScript(programPath, workingDirectory);
+            } else if (programPath.toLowerCase().endsWith(".exe")) {
+                return callExeProgram(programPath, workingDirectory);
+            } else {
+                throw new IllegalArgumentException("Unsupported program type: " + programPath);
+            }
         } catch (Exception e) {
             String errorMsg = String.format("Algorithm execution failed: %s", e.getMessage());
             logger.error(errorMsg, e);

+ 1 - 0
ips-admin/src/main/resources/application.yml

@@ -67,6 +67,7 @@ spring:
   redis:
     # 地址
     host: 101.126.133.7
+#    host: 127.0.0.1
     # 端口,默认为6379
     port: 6379
     # 数据库索引

+ 1 - 1
ips-admin/src/main/resources/logback.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <configuration>
     <!-- 日志存放路径 -->
-	<property name="log.path" value="/home/ruoyi/logs" />
+	<property name="log.path" value="/nupu-ips/logs" />
     <!-- 日志输出格式 -->
 	<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
 

+ 0 - 30
ips-ui/README.md

@@ -1,30 +0,0 @@
-## 开发
-
-```bash
-# 克隆项目
-git clone https://gitee.com/y_project/RuoYi-Vue
-
-# 进入项目目录
-cd ruoyi-ui
-
-# 安装依赖
-npm install
-
-# 建议不要直接使用 cnpm 安装依赖,会有各种诡异的 bug。可以通过如下操作解决 npm 下载速度慢的问题
-npm install --registry=https://registry.npmmirror.com
-
-# 启动服务
-npm run dev
-```
-
-浏览器访问 http://localhost:80
-
-## 发布
-
-```bash
-# 构建测试环境
-npm run build:stage
-
-# 构建生产环境
-npm run build:prod
-```

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 107
ips-ui/dist_electron/background.js


+ 0 - 100
ips-ui/dist_electron/package.json

@@ -1,100 +0,0 @@
-{
-  "name": "ruoyi",
-  "version": "3.8.6",
-  "description": "图像处理系统",
-  "author": "若依",
-  "license": "MIT",
-  "main": "background.js",
-  "scripts": {
-    "dev": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
-    "build:prod": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
-    "build:stage": "vue-cli-service build --mode staging",
-    "preview": "node build/index.js --preview",
-    "lint": "eslint --ext .js,.vue src",
-    "electron:serve": "vue-cli-service electron:serve",
-    "electron:build": "vue-cli-service electron:build",
-    "electron:build:win32": "vue-cli-service electron:build --win --ia32"
-  },
-  "husky": {
-    "hooks": {
-      "pre-commit": "lint-staged"
-    }
-  },
-  "lint-staged": {
-    "src/**/*.{js,vue}": [
-      "eslint --fix",
-      "git add"
-    ]
-  },
-  "keywords": [
-    "vue",
-    "admin",
-    "dashboard",
-    "element-ui",
-    "boilerplate",
-    "admin-template",
-    "management-system"
-  ],
-  "repository": {
-    "type": "git",
-    "url": "https://gitee.com/y_project/RuoYi-Vue.git"
-  },
-  "dependencies": {
-    "@riophae/vue-treeselect": "0.4.0",
-    "axios": "0.24.0",
-    "clipboard": "2.0.8",
-    "core-js": "3.25.3",
-    "echarts": "5.4.0",
-    "electron": "^30.1.0",
-    "electron-devtools-installer": "^3.2.0",
-    "element-ui": "2.15.13",
-    "file-saver": "2.0.5",
-    "fuse.js": "6.4.3",
-    "highlight.js": "9.18.5",
-    "js-beautify": "1.13.0",
-    "js-cookie": "3.0.1",
-    "jsencrypt": "3.0.0-rc.1",
-    "nprogress": "0.2.0",
-    "quill": "1.3.7",
-    "ruoyi": "file:",
-    "screenfull": "5.0.2",
-    "sortablejs": "1.10.2",
-    "vue": "2.6.12",
-    "vue-cli-plugin-electron-builder": "^2.1.1",
-    "vue-count-to": "1.0.13",
-    "vue-cropper": "0.5.5",
-    "vue-meta": "2.4.0",
-    "vue-router": "3.4.9",
-    "vuedraggable": "2.24.3",
-    "vuex": "3.6.0"
-  },
-  "devDependencies": {
-    "@vue/cli-plugin-babel": "4.4.6",
-    "@vue/cli-plugin-eslint": "4.4.6",
-    "@vue/cli-service": "4.4.6",
-    "babel-eslint": "10.1.0",
-    "babel-plugin-dynamic-import-node": "2.3.3",
-    "chalk": "4.1.0",
-    "compression-webpack-plugin": "5.0.2",
-    "connect": "3.6.6",
-    "electron": "^30.1.0",
-    "electron-devtools-installer": "^3.2.0",
-    "eslint": "7.15.0",
-    "eslint-plugin-vue": "7.2.0",
-    "lint-staged": "10.5.3",
-    "runjs": "4.4.2",
-    "sass": "1.32.13",
-    "sass-loader": "10.1.1",
-    "script-ext-html-webpack-plugin": "2.1.5",
-    "svg-sprite-loader": "5.1.1",
-    "vue-template-compiler": "2.6.12"
-  },
-  "engines": {
-    "node": ">=8.9",
-    "npm": ">= 3.0.0"
-  },
-  "browserslist": [
-    "> 1%",
-    "last 2 versions"
-  ]
-}

+ 4 - 8
ips-ui/package.json

@@ -1,8 +1,8 @@
 {
-  "name": "ruoyi",
+  "name": "ips",
   "version": "3.8.6",
   "description": "图像处理系统",
-  "author": "若依",
+  "author": "ips",
   "license": "MIT",
   "main": "background.js",
   "scripts": {
@@ -35,10 +35,6 @@
     "admin-template",
     "management-system"
   ],
-  "repository": {
-    "type": "git",
-    "url": "https://gitee.com/y_project/RuoYi-Vue.git"
-  },
   "dependencies": {
     "@riophae/vue-treeselect": "0.4.0",
     "axios": "0.24.0",
@@ -51,12 +47,12 @@
     "file-saver": "2.0.5",
     "fuse.js": "6.4.3",
     "highlight.js": "9.18.5",
+    "ips": "file:",
     "js-beautify": "1.13.0",
     "js-cookie": "3.0.1",
     "jsencrypt": "3.0.0-rc.1",
     "nprogress": "0.2.0",
     "quill": "1.3.7",
-    "ruoyi": "file:",
     "screenfull": "5.0.2",
     "sortablejs": "1.10.2",
     "vue": "2.6.12",
@@ -97,4 +93,4 @@
     "> 1%",
     "last 2 versions"
   ]
-}
+}

+ 25 - 25
ips-ui/src/background.js

@@ -30,8 +30,8 @@ async function createWindow() {
     },
   });
   win.maximize();
-  win.show();
-  win.webContents.openDevTools();
+//  win.show();
+//  win.webContents.openDevTools();
   ipcMain.on("getPrinterList", (event) => {
     //主线程获取打印机列表
     win.webContents.getPrintersAsync().then((data) => {
@@ -43,7 +43,7 @@ async function createWindow() {
   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);
-    if (!process.env.IS_TEST) win.webContents.openDevTools();
+//    if (!process.env.IS_TEST) win.webContents.openDevTools();
   } else {
     createProtocol("app");
     // Load the index.html when not in development
@@ -96,25 +96,25 @@ if (isDevelopment) {
     });
   }
 }
-let mainWindow;
-function createWindowNew() {
-  mainWindow = new BrowserWindow({
-    webPreferences: {
-      nodeIntegration: false, // 必须为 false
-      contextIsolation: true, // 必须为 true
-      preload: path.join(__dirname, "preload.js"), // 确保路径正确
-    },
-  });
-
-  mainWindow.loadFile("index.html"); // 或你的 Vue 入口文件
-}
-
-app.whenReady().then(createWindowNew);
-
-// 处理文件夹选择请求
-ipcMain.handle("select-folder", async () => {
-  const result = await dialog.showOpenDialog({
-    properties: ["openDirectory"],
-  });
-  return result.filePaths;
-});
+//let mainWindow;
+//function createWindowNew() {
+//  mainWindow = new BrowserWindow({
+//    webPreferences: {
+//      nodeIntegration: false, // 必须为 false
+//      contextIsolation: true, // 必须为 true
+//      preload: path.join(__dirname, "preload.js"), // 确保路径正确
+//    },
+//  });
+//
+//  mainWindow.loadFile("index.html"); // 或你的 Vue 入口文件
+//}
+//
+//app.whenReady().then(createWindowNew);
+//
+//// 处理文件夹选择请求
+//ipcMain.handle("select-folder", async () => {
+//  const result = await dialog.showOpenDialog({
+//    properties: ["openDirectory"],
+//  });
+//  return result.filePaths;
+//});

+ 8 - 8
ips-ui/src/components/RuoYi/Doc/index.vue

@@ -6,16 +6,16 @@
 
 <script>
 export default {
-  name: 'RuoYiDoc',
+  name: "RuoYiDoc",
   data() {
     return {
-      url: 'http://doc.ruoyi.vip/ruoyi-vue'
-    }
+      url: "",
+    };
   },
   methods: {
     goto() {
-      window.open(this.url)
-    }
-  }
-}
-</script>
+      window.open(this.url);
+    },
+  },
+};
+</script>

+ 60 - 59
ips-ui/src/layout/components/Navbar.vue

@@ -1,33 +1,36 @@
 <template>
   <div class="navbar">
-    <hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
-
-    <breadcrumb id="breadcrumb-container" class="breadcrumb-container" v-if="!topNav"/>
-    <top-nav id="topmenu-container" class="topmenu-container" v-if="topNav"/>
+    <hamburger
+      id="hamburger-container"
+      :is-active="sidebar.opened"
+      class="hamburger-container"
+      @toggleClick="toggleSideBar"
+    />
+
+    <breadcrumb
+      id="breadcrumb-container"
+      class="breadcrumb-container"
+      v-if="!topNav"
+    />
+    <top-nav id="topmenu-container" class="topmenu-container" v-if="topNav" />
 
     <div class="right-menu">
-      <template v-if="device!=='mobile'">
+      <template v-if="device !== 'mobile'">
         <search id="header-search" class="right-menu-item" />
-        
-        <el-tooltip content="源码地址" effect="dark" placement="bottom">
-          <ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect" />
-        </el-tooltip>
-
-        <el-tooltip content="文档地址" effect="dark" placement="bottom">
-          <ruo-yi-doc id="ruoyi-doc" class="right-menu-item hover-effect" />
-        </el-tooltip>
 
         <screenfull id="screenfull" class="right-menu-item hover-effect" />
 
         <el-tooltip content="布局大小" effect="dark" placement="bottom">
           <size-select id="size-select" class="right-menu-item hover-effect" />
         </el-tooltip>
-
       </template>
 
-      <el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
+      <el-dropdown
+        class="avatar-container right-menu-item hover-effect"
+        trigger="click"
+      >
         <div class="avatar-wrapper">
-          <img :src="avatar" class="user-avatar">
+          <img :src="avatar" class="user-avatar" />
           <i class="el-icon-caret-bottom" />
         </div>
         <el-dropdown-menu slot="dropdown">
@@ -47,15 +50,15 @@
 </template>
 
 <script>
-import { mapGetters } from 'vuex'
-import Breadcrumb from '@/components/Breadcrumb'
-import TopNav from '@/components/TopNav'
-import Hamburger from '@/components/Hamburger'
-import Screenfull from '@/components/Screenfull'
-import SizeSelect from '@/components/SizeSelect'
-import Search from '@/components/HeaderSearch'
-import RuoYiGit from '@/components/RuoYi/Git'
-import RuoYiDoc from '@/components/RuoYi/Doc'
+import { mapGetters } from "vuex";
+import Breadcrumb from "@/components/Breadcrumb";
+import TopNav from "@/components/TopNav";
+import Hamburger from "@/components/Hamburger";
+import Screenfull from "@/components/Screenfull";
+import SizeSelect from "@/components/SizeSelect";
+import Search from "@/components/HeaderSearch";
+// import RuoYiGit from "@/components/RuoYi/Git";
+// import RuoYiDoc from "@/components/RuoYi/Doc";
 
 export default {
   components: {
@@ -65,49 +68,47 @@ export default {
     Screenfull,
     SizeSelect,
     Search,
-    RuoYiGit,
-    RuoYiDoc
+    // RuoYiGit,
+    // RuoYiDoc,
   },
   computed: {
-    ...mapGetters([
-      'sidebar',
-      'avatar',
-      'device'
-    ]),
+    ...mapGetters(["sidebar", "avatar", "device"]),
     setting: {
       get() {
-        return this.$store.state.settings.showSettings
+        return this.$store.state.settings.showSettings;
       },
       set(val) {
-        this.$store.dispatch('settings/changeSetting', {
-          key: 'showSettings',
-          value: val
-        })
-      }
+        this.$store.dispatch("settings/changeSetting", {
+          key: "showSettings",
+          value: val,
+        });
+      },
     },
     topNav: {
       get() {
-        return this.$store.state.settings.topNav
-      }
-    }
+        return this.$store.state.settings.topNav;
+      },
+    },
   },
   methods: {
     toggleSideBar() {
-      this.$store.dispatch('app/toggleSideBar')
+      this.$store.dispatch("app/toggleSideBar");
     },
     async logout() {
-      this.$confirm('确定注销并退出系统吗?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        this.$store.dispatch('LogOut').then(() => {
-          this.$router.push('/login')
+      this.$confirm("确定注销并退出系统吗?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          this.$store.dispatch("LogOut").then(() => {
+            this.$router.push("/login");
+          });
         })
-      }).catch(() => {});
-    }
-  }
-}
+        .catch(() => {});
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>
@@ -116,18 +117,18 @@ export default {
   overflow: hidden;
   position: relative;
   background: #fff;
-  box-shadow: 0 1px 4px rgba(0,21,41,.08);
+  box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
 
   .hamburger-container {
     line-height: 46px;
     height: 100%;
     float: left;
     cursor: pointer;
-    transition: background .3s;
-    -webkit-tap-highlight-color:transparent;
+    transition: background 0.3s;
+    -webkit-tap-highlight-color: transparent;
 
     &:hover {
-      background: rgba(0, 0, 0, .025)
+      background: rgba(0, 0, 0, 0.025);
     }
   }
 
@@ -164,10 +165,10 @@ export default {
 
       &.hover-effect {
         cursor: pointer;
-        transition: background .3s;
+        transition: background 0.3s;
 
         &:hover {
-          background: rgba(0, 0, 0, .025)
+          background: rgba(0, 0, 0, 0.025);
         }
       }
     }

+ 67 - 39
ips-ui/src/views/login.vue

@@ -1,6 +1,11 @@
 <template>
   <div class="login">
-    <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
+    <el-form
+      ref="loginForm"
+      :model="loginForm"
+      :rules="loginRules"
+      class="login-form"
+    >
       <h3 class="title">图像处理系统</h3>
       <el-form-item prop="username">
         <el-input
@@ -9,7 +14,11 @@
           auto-complete="off"
           placeholder="账号"
         >
-          <svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
+          <svg-icon
+            slot="prefix"
+            icon-class="user"
+            class="el-input__icon input-icon"
+          />
         </el-input>
       </el-form-item>
       <el-form-item prop="password">
@@ -20,7 +29,11 @@
           placeholder="密码"
           @keyup.enter.native="handleLogin"
         >
-          <svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
+          <svg-icon
+            slot="prefix"
+            icon-class="password"
+            class="el-input__icon input-icon"
+          />
         </el-input>
       </el-form-item>
       <el-form-item prop="code" v-if="captchaEnabled">
@@ -31,32 +44,42 @@
           style="width: 63%"
           @keyup.enter.native="handleLogin"
         >
-          <svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" />
+          <svg-icon
+            slot="prefix"
+            icon-class="validCode"
+            class="el-input__icon input-icon"
+          />
         </el-input>
         <div class="login-code">
-          <img :src="codeUrl" @click="getCode" class="login-code-img"/>
+          <img :src="codeUrl" @click="getCode" class="login-code-img" />
         </div>
       </el-form-item>
-      <el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住密码</el-checkbox>
-      <el-form-item style="width:100%;">
+      <el-checkbox
+        v-model="loginForm.rememberMe"
+        style="margin: 0px 0px 25px 0px"
+        >记住密码</el-checkbox
+      >
+      <el-form-item style="width: 100%">
         <el-button
           :loading="loading"
           size="medium"
           type="primary"
-          style="width:100%;"
+          style="width: 100%"
           @click.native.prevent="handleLogin"
         >
           <span v-if="!loading">登 录</span>
           <span v-else>登 录 中...</span>
         </el-button>
-        <div style="float: right;" v-if="register">
-          <router-link class="link-type" :to="'/register'">立即注册</router-link>
+        <div style="float: right" v-if="register">
+          <router-link class="link-type" :to="'/register'"
+            >立即注册</router-link
+          >
         </div>
       </el-form-item>
     </el-form>
     <!--  底部  -->
     <div class="el-login-footer">
-      <span>Copyright © 2018-2023 ruoyi.vip All Rights Reserved.</span>
+      <span></span>
     </div>
   </div>
 </template>
@@ -64,7 +87,7 @@
 <script>
 import { getCodeImg } from "@/api/login";
 import Cookies from "js-cookie";
-import { encrypt, decrypt } from '@/utils/jsencrypt'
+import { encrypt, decrypt } from "@/utils/jsencrypt";
 
 export default {
   name: "Login",
@@ -76,32 +99,32 @@ export default {
         password: "admin123",
         rememberMe: false,
         code: "",
-        uuid: ""
+        uuid: "",
       },
       loginRules: {
         username: [
-          { required: true, trigger: "blur", message: "请输入您的账号" }
+          { required: true, trigger: "blur", message: "请输入您的账号" },
         ],
         password: [
-          { required: true, trigger: "blur", message: "请输入您的密码" }
+          { required: true, trigger: "blur", message: "请输入您的密码" },
         ],
-        code: [{ required: true, trigger: "change", message: "请输入验证码" }]
+        code: [{ required: true, trigger: "change", message: "请输入验证码" }],
       },
       loading: false,
       // 验证码开关
       captchaEnabled: true,
       // 注册开关
       register: false,
-      redirect: undefined
+      redirect: undefined,
     };
   },
   watch: {
     $route: {
-      handler: function(route) {
+      handler: function (route) {
         this.redirect = route.query && route.query.redirect;
       },
-      immediate: true
-    }
+      immediate: true,
+    },
   },
   created() {
     this.getCode();
@@ -109,8 +132,9 @@ export default {
   },
   methods: {
     getCode() {
-      getCodeImg().then(res => {
-        this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled;
+      getCodeImg().then((res) => {
+        this.captchaEnabled =
+          res.captchaEnabled === undefined ? true : res.captchaEnabled;
         if (this.captchaEnabled) {
           this.codeUrl = "data:image/gif;base64," + res.img;
           this.loginForm.uuid = res.uuid;
@@ -120,39 +144,43 @@ export default {
     getCookie() {
       const username = localStorage.getItem("username");
       const password = localStorage.getItem("password");
-      const rememberMe = localStorage.getItem('rememberMe')
-      console.log(password,decrypt(password),rememberMe,Boolean(rememberMe))
+      const rememberMe = localStorage.getItem("rememberMe");
+      console.log(password, decrypt(password), rememberMe, Boolean(rememberMe));
       this.loginForm = {
         username: username === undefined ? this.loginForm.username : username,
-        password: password === null ? this.loginForm.password : decrypt(password),
-        rememberMe: rememberMe === null ? false : Boolean(rememberMe)
+        password:
+          password === null ? this.loginForm.password : decrypt(password),
+        rememberMe: rememberMe === null ? false : Boolean(rememberMe),
       };
     },
     handleLogin() {
-      this.$refs.loginForm.validate(valid => {
+      this.$refs.loginForm.validate((valid) => {
         if (valid) {
           this.loading = true;
           if (this.loginForm.rememberMe) {
             localStorage.setItem("username", this.loginForm.username);
             localStorage.setItem("password", encrypt(this.loginForm.password));
-            localStorage.setItem('rememberMe', this.loginForm.rememberMe);
+            localStorage.setItem("rememberMe", this.loginForm.rememberMe);
           } else {
             localStorage.removeItem("username");
             localStorage.removeItem("password");
-            localStorage.removeItem('rememberMe');
+            localStorage.removeItem("rememberMe");
           }
-          this.$store.dispatch("Login", this.loginForm).then(() => {
-            this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
-          }).catch(() => {
-            this.loading = false;
-            if (this.captchaEnabled) {
-              this.getCode();
-            }
-          });
+          this.$store
+            .dispatch("Login", this.loginForm)
+            .then(() => {
+              this.$router.push({ path: this.redirect || "/" }).catch(() => {});
+            })
+            .catch(() => {
+              this.loading = false;
+              if (this.captchaEnabled) {
+                this.getCode();
+              }
+            });
         }
       });
-    }
-  }
+    },
+  },
 };
 </script>
 

+ 107 - 108
ips-ui/vue.config.js

@@ -1,15 +1,15 @@
-'use strict'
-const path = require('path')
+"use strict";
+const path = require("path");
 
 function resolve(dir) {
-  return path.join(__dirname, dir)
+  return path.join(__dirname, dir);
 }
 
-const CompressionPlugin = require('compression-webpack-plugin')
+const CompressionPlugin = require("compression-webpack-plugin");
 
-const name = process.env.VUE_APP_TITLE || '图像处理系统' // 网页标题
+const name = process.env.VUE_APP_TITLE || "图像处理系统"; // 网页标题
 
-const port = process.env.port || process.env.npm_config_port || 80 // 端口
+const port = process.env.port || process.env.npm_config_port || 80; // 端口
 
 // vue.config.js 配置说明
 //官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions
@@ -17,19 +17,18 @@ const port = process.env.port || process.env.npm_config_port || 80 // 端口
 module.exports = {
   // 部署生产环境和开发环境下的URL。
   // 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上
-  // 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
   publicPath: "./",
   // 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist)
-  outputDir: 'dist',
+  outputDir: "dist",
   // 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
-  assetsDir: 'static',
+  assetsDir: "static",
   // 是否开启eslint保存检测,有效值:ture | false | 'error'
-  lintOnSave: process.env.NODE_ENV === 'development',
+  lintOnSave: process.env.NODE_ENV === "development",
   // 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
   productionSourceMap: false,
   // webpack-dev-server 相关配置
   devServer: {
-    host: '0.0.0.0',
+    host: "0.0.0.0",
     port: port,
     open: true,
     proxy: {
@@ -38,143 +37,143 @@ module.exports = {
         target: `http://localhost:8080`,
         changeOrigin: true,
         pathRewrite: {
-          ['^' + process.env.VUE_APP_BASE_API]: ''
-        }
-      }
+          ["^" + process.env.VUE_APP_BASE_API]: "",
+        },
+      },
     },
-    disableHostCheck: true
+    disableHostCheck: true,
   },
   css: {
     loaderOptions: {
       sass: {
-        sassOptions: { outputStyle: "expanded" }
-      }
-    }
+        sassOptions: { outputStyle: "expanded" },
+      },
+    },
   },
   configureWebpack: {
     name: name,
     resolve: {
       alias: {
-        '@': resolve('src')
-      }
+        "@": resolve("src"),
+      },
     },
     plugins: [
-      // http://doc.ruoyi.vip/ruoyi-vue/other/faq.html#使用gzip解压缩静态文件
       new CompressionPlugin({
-        cache: false,                   // 不启用文件缓存
-        test: /\.(js|css|html)?$/i,     // 压缩文件格式
-        filename: '[path].gz[query]',   // 压缩后的文件名
-        algorithm: 'gzip',              // 使用gzip压缩
-        minRatio: 0.8                   // 压缩率小于1才会压缩
-      })
+        cache: false, // 不启用文件缓存
+        test: /\.(js|css|html)?$/i, // 压缩文件格式
+        filename: "[path].gz[query]", // 压缩后的文件名
+        algorithm: "gzip", // 使用gzip压缩
+        minRatio: 0.8, // 压缩率小于1才会压缩
+      }),
     ],
   },
   chainWebpack(config) {
-    config.plugins.delete('preload') // TODO: need test
-    config.plugins.delete('prefetch') // TODO: need test
+    config.plugins.delete("preload"); // TODO: need test
+    config.plugins.delete("prefetch"); // TODO: need test
 
     // set svg-sprite-loader
+    config.module.rule("svg").exclude.add(resolve("src/assets/icons")).end();
     config.module
-      .rule('svg')
-      .exclude.add(resolve('src/assets/icons'))
-      .end()
-    config.module
-      .rule('icons')
+      .rule("icons")
       .test(/\.svg$/)
-      .include.add(resolve('src/assets/icons'))
+      .include.add(resolve("src/assets/icons"))
       .end()
-      .use('svg-sprite-loader')
-      .loader('svg-sprite-loader')
+      .use("svg-sprite-loader")
+      .loader("svg-sprite-loader")
       .options({
-        symbolId: 'icon-[name]'
+        symbolId: "icon-[name]",
       })
-      .end()
+      .end();
 
-    config.when(process.env.NODE_ENV !== 'development', config => {
-          config
-            .plugin('ScriptExtHtmlWebpackPlugin')
-            .after('html')
-            .use('script-ext-html-webpack-plugin', [{
+    config.when(process.env.NODE_ENV !== "development", (config) => {
+      config
+        .plugin("ScriptExtHtmlWebpackPlugin")
+        .after("html")
+        .use("script-ext-html-webpack-plugin", [
+          {
             // `runtime` must same as runtimeChunk name. default is `runtime`
-              inline: /runtime\..*\.js$/
-            }])
-            .end()
+            inline: /runtime\..*\.js$/,
+          },
+        ])
+        .end();
 
-          config.optimization.splitChunks({
-            chunks: 'all',
-            cacheGroups: {
-              libs: {
-                name: 'chunk-libs',
-                test: /[\\/]node_modules[\\/]/,
-                priority: 10,
-                chunks: 'initial' // only package third parties that are initially dependent
-              },
-              elementUI: {
-                name: 'chunk-elementUI', // split elementUI into a single package
-                test: /[\\/]node_modules[\\/]_?element-ui(.*)/, // in order to adapt to cnpm
-                priority: 20 // the weight needs to be larger than libs and app or it will be packaged into libs or app
-              },
-              commons: {
-                name: 'chunk-commons',
-                test: resolve('src/components'), // can customize your rules
-                minChunks: 3, //  minimum common number
-                priority: 5,
-                reuseExistingChunk: true
-              }
-            }
-          })
+      config.optimization.splitChunks({
+        chunks: "all",
+        cacheGroups: {
+          libs: {
+            name: "chunk-libs",
+            test: /[\\/]node_modules[\\/]/,
+            priority: 10,
+            chunks: "initial", // only package third parties that are initially dependent
+          },
+          elementUI: {
+            name: "chunk-elementUI", // split elementUI into a single package
+            test: /[\\/]node_modules[\\/]_?element-ui(.*)/, // in order to adapt to cnpm
+            priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
+          },
+          commons: {
+            name: "chunk-commons",
+            test: resolve("src/components"), // can customize your rules
+            minChunks: 3, //  minimum common number
+            priority: 5,
+            reuseExistingChunk: true,
+          },
+        },
+      });
 
-          config.optimization.runtimeChunk('single'),
-          {
-             from: path.resolve(__dirname, './public/robots.txt'), //防爬虫文件
-             to: './' //到根目录下
-          }
-    })
+      config.optimization.runtimeChunk("single"),
+        {
+          from: path.resolve(__dirname, "./public/robots.txt"), //防爬虫文件
+          to: "./", //到根目录下
+        };
+    });
   },
   pluginOptions: {
     electronBuilder: {
       chainWebpackMainProcess: (config) => {
-        config.output.filename('background.js');
+        config.output.filename("background.js");
       },
       // preload: 'src/preload.js',
       nodeIntegration: true,
       contextIsolation: false,
       enableRemoteModule: true,
-      publish: [{
-        "provider": "xxxx有限公司",
-        "url": "http://xxxxx/"
-      }],
-      "copyright": "Copyright © 2022",
-      builderOptions:{
-        appId: 'com.ruoyi',
-        productName: 'ruoyi',
-        nsis:{
-          "oneClick": false,
-          "guid": "idea",
-          "perMachine": true,
-          "allowElevation": true,
-          "allowToChangeInstallationDirectory": true,
-          "installerIcon": "build/app.ico",
-          "uninstallerIcon": "build/app.ico",
-          "installerHeaderIcon": "build/app.ico",
-          "createDesktopShortcut": true,
-          "createStartMenuShortcut": true,
-          "shortcutName": "若依管理系統"
+      publish: [
+        {
+          provider: "xxxx有限公司",
+          url: "http://xxxxx/",
+        },
+      ],
+      copyright: "Copyright © 2022",
+      builderOptions: {
+        appId: "com.ips",
+        productName: "ips",
+        nsis: {
+          oneClick: false,
+          guid: "idea",
+          perMachine: true,
+          allowElevation: true,
+          allowToChangeInstallationDirectory: true,
+          installerIcon: "build/app.ico",
+          uninstallerIcon: "build/app.ico",
+          installerHeaderIcon: "build/app.ico",
+          createDesktopShortcut: true,
+          createStartMenuShortcut: true,
+          shortcutName: "若依管理系統",
         },
         win: {
-          "icon": "build/app.ico",
-          "target": [
+          icon: "build/app.ico",
+          target: [
             {
-              "target": "nsis",			//使用nsis打成安装包,"portable"打包成免安装版
-              "arch": [
-                "ia32",				//32位
-                "x64" 				//64位
-              ]
-            }
-          ]
+              target: "nsis", //使用nsis打成安装包,"portable"打包成免安装版
+              arch: [
+                "ia32", //32位
+                "x64", //64位
+              ],
+            },
+          ],
         },
       },
       // preload: path.join(__dirname, "/dist_electron/preload.js"),
     },
-  }
-}
+  },
+};

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels