From 85d60d9c9a44e43ad153fc18c47aad59e0550717 Mon Sep 17 00:00:00 2001 From: tangxinyue <524779910@qq.com> Date: Fri, 24 Jul 2026 15:16:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E9=83=A8=E5=88=86?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E8=AF=B7=E6=B1=82=E8=B7=AF=E5=BE=84=E7=A1=AC?= =?UTF-8?q?=E7=BC=96=E7=A0=81=E5=B8=A6=E6=9C=89=20/src/public=20=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E6=9C=AA=E5=8C=B9=E9=85=8D=E7=89=A9=E7=90=86=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E8=80=8C=E8=90=BD=E5=85=A5=20endIndex=20=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=20text/html=20=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/core/router/index.cjs | 15 +++++++++++---- src/components/simulator/StatusBar.vue | 8 ++++---- src/views/Profile.vue | 6 +++--- src/views/wxPage/ChatEdit.vue | 6 +++--- 4 files changed, 21 insertions(+), 14 deletions(-) diff --git a/service/core/router/index.cjs b/service/core/router/index.cjs index 12a614a..fe35734 100644 --- a/service/core/router/index.cjs +++ b/service/core/router/index.cjs @@ -86,14 +86,21 @@ function getMimeType(filePath) { const matchFile = async (request, response) => { return new Promise((resolve) => { const cleanPath = decodeURIComponent(request.url.split('?')[0]) - fs.readFile(dist + cleanPath, (err, file) => { + let targetPath = dist + cleanPath + if (!fs.existsSync(targetPath)) { + const mappedPath = dist + cleanPath.replace(/^\/(src\/public|public|src)/, '') + if (fs.existsSync(mappedPath)) { + targetPath = mappedPath + } + } + fs.readFile(targetPath, (err, file) => { if (!err) { const mimetype = getMimeType(cleanPath) - const responseHdeaders = { 'Content-Type': mimetype } + const responseHeaders = { 'Content-Type': mimetype } if (cleanPath.endsWith("-sw.js")) { - responseHdeaders["Service-Worker-Allowed"] = '/' + responseHeaders["Service-Worker-Allowed"] = '/' } - response.writeHead(httpOk, responseHdeaders) + response.writeHead(httpOk, responseHeaders) response.end(file) // logger.info(`${request.method} ${httpOk} ${request.url}`) resolve(true) diff --git a/src/components/simulator/StatusBar.vue b/src/components/simulator/StatusBar.vue index 33feda2..1abecc9 100644 --- a/src/components/simulator/StatusBar.vue +++ b/src/components/simulator/StatusBar.vue @@ -2,9 +2,9 @@
-
+
+
我的作品
+
xxx领取了xxx的红包" }
+ { label: '+ 红包领取', command: "
xxx领取了xxx的红包" }
])
let msgIdCounter = 1
@@ -630,9 +630,9 @@ function onRedpacketStatusChange(status) {
let content = ""
const theirName = settings.theirName || '对方'
if (selectedMsg.value.sender === 'me') {
- content = `
${theirName}领取了你的红包`
+ content = `
${theirName}领取了你的红包`
} else {
- content = `
你领取了${theirName}的红包`
+ content = `
你领取了${theirName}的红包`
}
messages.value.push({