Jelajahi Sumber

初始化调整

zhangshuling 1 tahun lalu
induk
melakukan
04b4845c38

+ 12 - 15
xzl-admin/src/main/java/com/xzl/web/controller/userPortrait/ViewController.java

@@ -2,6 +2,7 @@ package com.xzl.web.controller.userPortrait;
 
 import com.xzl.common.utils.DateUtils;
 import org.aspectj.util.FileUtil;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -30,13 +31,16 @@ import java.util.Map;
 @RequestMapping("/user-portait")
 public class ViewController {
 
-  String path = "/usr/local/python/";
+  @Value("${pythonFilePath}")
+  String pythonFilePath;
 
+  @Value("${pythonPath}")
+  String pythonPath;
 
   @GetMapping("/show")
   public void show(HttpServletResponse response) throws Exception {
     String wordcloudImageFileName = "wordcloud.png";
-    File wordcloudImageFile = new File(path, wordcloudImageFileName);
+    File wordcloudImageFile = new File(pythonFilePath, wordcloudImageFileName);
     if (wordcloudImageFile.exists()) {
       InputStream inputStream = null;
       ServletOutputStream outputStream = null;
@@ -71,32 +75,25 @@ public class ViewController {
     Map rs = new HashMap();
     // 先判断有没有 wordcloud.txt, 没有就生成一个,有就备份一个,然后重新生成新的内容
     String wordcloudFileName = "wordcloud.txt";
-    File wordcloudFile = new File(path, wordcloudFileName);
+    File wordcloudFile = new File(pythonFilePath, wordcloudFileName);
 
     String wordcloudImageFileName = "wordcloud.png";
-    File wordcloudImageFile = new File(path, wordcloudImageFileName);
+    File wordcloudImageFile = new File(pythonFilePath, wordcloudImageFileName);
 
     // 如果词云文件存在,就先都备份一下,然后再生成新的
     String timePrefix = DateUtils.dateTimeNow();
     if (wordcloudFile.exists()) {
-      FileUtil.copyFile(wordcloudFile, new File(path, timePrefix + "-" + wordcloudFileName));
+      FileUtil.copyFile(wordcloudFile, new File(pythonFilePath, timePrefix + "-" + wordcloudFileName));
     }
     if (wordcloudImageFile.exists()) {
-      FileUtil.copyFile(wordcloudImageFile, new File(path, timePrefix + "-" + wordcloudImageFileName));
+      FileUtil.copyFile(wordcloudImageFile, new File(pythonFilePath, timePrefix + "-" + wordcloudImageFileName));
     }
-    // 获取新的内容,写入 wordcloud.txt
+    //TODO 获取新的内容,写入 wordcloud.txt
 
     // 调用python脚本, 生成新的词云图片
-    String[] commands = {"/usr/local/Cellar/python@3.10/3.10.11/bin/python3.10", "/usr/local/python/word-cloud.py"};
+    String[] commands = {pythonPath, "/usr/local/python/word-cloud.py"};
     ProcessBuilder processBuilder = new ProcessBuilder(commands);
     Process process = processBuilder.start();
-
-    // 读取命令执行结果
-//    BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
-//    String line;
-//    while ((line = reader.readLine()) != null) {
-//      System.out.println(line);
-//    }
     // 等待命令执行完成
     int exitCode = process.waitFor();
     System.out.println("命令执行结果:" + exitCode);

+ 3 - 1
xzl-admin/src/main/resources/application-dev.yml

@@ -63,4 +63,6 @@ spring:
                     merge-sql: true
                 wall:
                     config:
-                        multi-statement-allow: true
+                        multi-statement-allow: true
+pythonFilePath: /usr/local/python/
+pythonPath: /usr/local/Cellar/python@3.10/3.10.11/bin/python3.10

+ 65 - 9
xzl-admin/src/main/resources/application-prod.yml

@@ -1,10 +1,66 @@
+# 数据源配置
 spring:
-  datasource:
-    type: com.alibaba.druid.pool.DruidDataSource
-    driverClassName: com.mysql.cj.jdbc.Driver
-    druid:
-      # 主库数据源
-      master:
-          url: jdbc:mysql://10.70.192.124:3306/xtdb?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
-          username: root
-          password: xtyc@2023@xzl
+    datasource:
+        type: com.alibaba.druid.pool.DruidDataSource
+        driverClassName: com.mysql.cj.jdbc.Driver
+        druid:
+            # 主库数据源
+            master:
+                url: jdbc:mysql://10.70.192.124:3306/xtdb?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
+                username: root
+                password: xtyc@2023@xzl
+            #                url: jdbc:mysql://localhost:3306/xtdb?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
+            #                username: root
+            #                password: 1234
+            # 从库数据源
+            slave:
+                # 从数据源开关/默认关闭
+                enabled: false
+                url:
+                username:
+                password:
+            # 初始连接数
+            initialSize: 5
+            # 最小连接池数量
+            minIdle: 10
+            # 最大连接池数量
+            maxActive: 20
+            # 配置获取连接等待超时的时间
+            maxWait: 60000
+            # 配置连接超时时间
+            connectTimeout: 30000
+            # 配置网络超时时间
+            socketTimeout: 60000
+            # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+            timeBetweenEvictionRunsMillis: 60000
+            # 配置一个连接在池中最小生存的时间,单位是毫秒
+            minEvictableIdleTimeMillis: 300000
+            # 配置一个连接在池中最大生存的时间,单位是毫秒
+            maxEvictableIdleTimeMillis: 900000
+            # 配置检测连接是否有效
+            validationQuery: SELECT 1 FROM DUAL
+            testWhileIdle: true
+            testOnBorrow: false
+            testOnReturn: false
+            webStatFilter:
+                enabled: true
+            statViewServlet:
+                enabled: true
+                # 设置白名单,不填则允许所有访问
+                allow:
+                url-pattern: /druid/*
+                # 控制台管理用户名和密码
+                login-username: xzl
+                login-password: 123456
+            filter:
+                stat:
+                    enabled: true
+                    # 慢SQL记录
+                    log-slow-sql: true
+                    slow-sql-millis: 1000
+                    merge-sql: true
+                wall:
+                    config:
+                        multi-statement-allow: true
+pythonFilePath: /usr/local/python/
+pythonPath: /usr/bin/python3

+ 1 - 1
xzl-ui/.env.production

@@ -1,5 +1,5 @@
 # 页面标题
-VUE_APP_TITLE = XZL管理系统
+VUE_APP_TITLE = 仙桃烟草用户画像管理系统
 
 # 生产环境配置
 ENV = 'production'

+ 1 - 1
xzl-ui/package.json

@@ -1,7 +1,7 @@
 {
   "name": "xzl",
   "version": "3.8.6",
-  "description": "XZL管理系统",
+  "description": "仙桃烟草用户画像管理系统",
   "author": "XZL",
   "license": "MIT",
   "scripts": {

TEMPAT SAMPAH
xzl-ui/public/favicon.ico


TEMPAT SAMPAH
xzl-ui/src/assets/logo/logo.jpg


+ 1 - 1
xzl-ui/src/layout/components/Sidebar/Logo.vue

@@ -14,7 +14,7 @@
 </template>
 
 <script>
-import logoImg from '@/assets/logo/logo.png'
+import logoImg from '@/assets/logo/logo.jpg'
 import variables from '@/assets/styles/variables.scss'
 
 export default {

+ 2 - 2
xzl-ui/src/views/login.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="login">
     <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
-      <h3 class="title">XZL后台管理系统</h3>
+      <h3 class="title">仙桃烟草用户画像管理系统</h3>
       <el-form-item prop="username">
         <el-input
           v-model="loginForm.username"
@@ -55,7 +55,7 @@
       </el-form-item>
     </el-form>
     <!--  底部  -->
-    <div class="el-login-footer">
+    <div class="el-login-footer" style="display:none">
       <span>Copyright © 2018-2023 xzl.vip All Rights Reserved.</span>
     </div>
   </div>

+ 1 - 1
xzl-ui/src/views/tool/build/index.vue

@@ -147,7 +147,7 @@ import { makeUpHtml, vueTemplate, vueScript, cssStyle } from '@/utils/generator/
 import { makeUpJs } from '@/utils/generator/js'
 import { makeUpCss } from '@/utils/generator/css'
 import drawingDefault from '@/utils/generator/drawingDefault'
-import logo from '@/assets/logo/logo.png'
+import logo from '@/assets/logo/logo.jpg'
 import CodeTypeDialog from './CodeTypeDialog'
 import DraggableItem from './DraggableItem'