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({