From 7809870c4fc0d7216a3547edd5c5e5704266fbf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A5=9E=E4=BB=99=E9=83=BD=E6=B2=A1=E7=94=A8?= <615206459@qq.com> Date: Fri, 13 Oct 2023 10:50:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/cool/eps/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build/cool/eps/index.ts b/build/cool/eps/index.ts index 1eb4ff1..b9d45f1 100644 --- a/build/cool/eps/index.ts +++ b/build/cool/eps/index.ts @@ -2,7 +2,7 @@ import { createDir, error, firstUpperCase, readFile, toCamel } from "../utils"; import { join } from "path"; import { Entity, DistPath } from "./config"; import axios from "axios"; -import { isArray, isEmpty, last } from "lodash"; +import { isArray, isEmpty, last, merge } from "lodash"; import { createWriteStream } from "fs"; import prettier from "prettier"; import { proxy } from "../../../src/config/proxy"; @@ -50,7 +50,7 @@ async function getData(temps: any[]) { // 本地文件 try { - list = JSON.parse(readFile(join(DistPath, "eps.json")) || "[]"); + list = JSON.parse(readFile(join(DistPath, "eps.json"))); } catch (err) { error(`[eps] ${join(DistPath, "eps.json")} 文件异常, ${err.message}`); } @@ -76,7 +76,7 @@ async function getData(temps: any[]) { } }) .catch(() => { - error(`[eps] 获取失败, ${url} 无法访问!`); + error(`[eps] 获取失败, ${url} 无法访问,请启动服务!`); }); // 判断是否重复项 @@ -85,7 +85,7 @@ async function getData(temps: any[]) { const d = list.find((a) => e.prefix === a.prefix); if (d) { - Object.assign(d, e); + merge(d, e); } else { list.push(e); }