From 42d197dd2d63a12bd0467b39a7d74588e75afb95 Mon Sep 17 00:00:00 2001 From: tangxinyue <524779910@qq.com> Date: Fri, 24 Jul 2026 15:35:56 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E7=BB=84=E4=BB=B6=E6=8A=A5=E9=94=99=20(Faile?= =?UTF-8?q?d=20to=20fetch=20dynamically=20imported=20module)=20-=20?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=20index.html=20no-cache=20=E9=98=B2=E6=97=A7?= =?UTF-8?q?=E7=BC=93=E5=AD=98=EF=BC=8C=E5=A2=9E=E5=8A=A0=20CORS=20?= =?UTF-8?q?=E6=A0=87=E5=A4=B4=E5=8F=8A=20router.onError=20=E9=87=8D?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/core/router/index.cjs | 13 +++++++++++-- src/components/simulator/StatusBar.vue | 8 ++++---- src/router/index.js | 8 +++++++- src/views/Profile.vue | 6 +++--- src/views/wxPage/ChatEdit.vue | 6 +++--- 5 files changed, 28 insertions(+), 13 deletions(-) diff --git a/service/core/router/index.cjs b/service/core/router/index.cjs index fe35734..df2197d 100644 --- a/service/core/router/index.cjs +++ b/service/core/router/index.cjs @@ -96,7 +96,10 @@ const matchFile = async (request, response) => { fs.readFile(targetPath, (err, file) => { if (!err) { const mimetype = getMimeType(cleanPath) - const responseHeaders = { 'Content-Type': mimetype } + const responseHeaders = { + 'Content-Type': mimetype, + 'Access-Control-Allow-Origin': '*' + } if (cleanPath.endsWith("-sw.js")) { responseHeaders["Service-Worker-Allowed"] = '/' } @@ -115,7 +118,13 @@ const endIndex = async (request, response) => { console.log(dist + '/index.html') fs.readFile(dist + '/index.html', (err, html) => { if (!err) { - response.writeHead(httpOk, { 'Content-type': 'text/html;charset=utf-8' }) + response.writeHead(httpOk, { + 'Content-type': 'text/html;charset=utf-8', + 'Cache-Control': 'no-cache, no-store, must-revalidate', + 'Pragma': 'no-cache', + 'Expires': '0', + 'Access-Control-Allow-Origin': '*' + }) response.end(html) logger.info(`${request.method} ${httpOk} ${request.url}`) } diff --git a/src/components/simulator/StatusBar.vue b/src/components/simulator/StatusBar.vue index 1abecc9..33feda2 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({