Xiao_123 2 settimane fa
parent
commit
4b5df1fde4
5 ha cambiato i file con 2 aggiunte e 487 eliminazioni
  1. 0 13
      ecosystem.config.js
  2. 1 4
      package.json
  3. 0 408
      pnpm-lock.yaml
  4. 0 61
      server/server.js
  5. 1 1
      vite.config.ts

+ 0 - 13
ecosystem.config.js

@@ -1,13 +0,0 @@
-module.exports = {
-  apps: [{
-    name: 'weixin-crawler',      // 服务名称
-    script: './server/server.js',  // 入口文件
-    instances: 'max',            // 使用所有CPU核心
-    autorestart: true,           // 崩溃后自动重启
-    watch: false,                // 不监听文件变化(生产环境禁用)
-    env: {
-      NODE_ENV: 'demo',    			// 环境变量
-      PORT: 9998                // 端口
-    }
-  }]
-};

+ 1 - 4
package.json

@@ -23,8 +23,7 @@
     "lint:eslint": "eslint --fix --ext .js,.ts,.vue ./src",
     "lint:format": "prettier --write --loglevel warn \"src/**/*.{js,ts,json,tsx,css,less,scss,vue,html,md}\"",
     "lint:style": "stylelint --fix \"./src/**/*.{vue,less,postcss,css,scss}\" --cache --cache-location node_modules/.cache/stylelint/",
-    "lint:lint-staged": "lint-staged -c ",
-    "start": "pm2 start ecosystem.config.js"
+    "lint:lint-staged": "lint-staged -c "
   },
   "dependencies": {
     "@element-plus/icons-vue": "^2.1.0",
@@ -43,7 +42,6 @@
     "benz-amr-recorder": "^1.1.5",
     "bpmn-js-token-simulation": "^0.10.0",
     "camunda-bpmn-moddle": "^7.0.1",
-    "cors": "^2.8.5",
     "cropperjs": "^1.6.1",
     "crypto-js": "^4.2.0",
     "dayjs": "^1.11.10",
@@ -52,7 +50,6 @@
     "echarts": "^5.5.0",
     "echarts-wordcloud": "^2.1.0",
     "element-plus": "2.6.1",
-    "express": "^5.1.0",
     "fast-xml-parser": "^4.3.2",
     "highlight.js": "^11.9.0",
     "js-base64": "^3.7.7",

File diff suppressed because it is too large
+ 0 - 408
pnpm-lock.yaml


+ 0 - 61
server/server.js

@@ -1,61 +0,0 @@
-const express = require('express');
-const axios = require('axios');
-const app = express();
-
-const cors = require('cors');
-app.use(cors());
-
-// 中间件,用于解析 JSON 请求体
-app.use(express.json());
-
-// 接口路由
-app.post('/process-urls', async (req, res) => {
-  try {
-    const { urlArr } = req.body;
-        
-    if (!urlArr || !Array.isArray(urlArr)) {
-      return res.status(400).json({ error: 'urlArr 必须是一个数组' });
-    }
-
-    const requests = urlArr.map(url => {
-      return axios.get(url, {
-        headers: {
-          'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36',
-          'Referer': 'https://mp.weixin.qq.com/',
-          'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'
-        }
-      })
-    	.then(res => ({
-        url: url,
-        data: res.data
-      }))
-      .catch(error => ({
-        url: url,
-        error: error.message
-      }));
-    });
-
-    const results = await Promise.all(requests);
-        
-    // 过滤掉没有数据的项
-    const contents = results.filter(item => item.data);
-        
-    res.json({ contents });
-  } catch (error) {
-    console.error('处理请求时出错:', error);
-    res.status(500).json({ error: '服务器内部错误' });
-  }
-});
-
-// 静态资源托管
-const path = require('path');
-app.use(express.static(path.join(__dirname, '../dist')));
-app.get('*', (req, res) => {
-  res.sendFile(path.join(__dirname, '../dist/index.html'));
-});
-
-// 启动服务器
-const PORT = 9998;
-app.listen(PORT, () => {
-  console.log(`服务器运行在 http://localhost:${PORT}`);
-});

+ 1 - 1
vite.config.ts

@@ -53,7 +53,7 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
         //   rewrite: (path) => path.replace(new RegExp(`^/weixin-article`), '')
         // },
         '/process-urls': {
-          target: 'http://localhost:9998',
+          target: 'http://localhost:3300',
           secure: true,
           changeOrigin: true
         }

Some files were not shown because too many files changed in this diff