diff --git a/src/__tests__/server.test.ts b/src/__tests__/server.test.ts index 7c39892..655443c 100644 --- a/src/__tests__/server.test.ts +++ b/src/__tests__/server.test.ts @@ -43,7 +43,7 @@ test('通知中心验证签名、项目域名和幂等键', async () => { const first = await fetch(`http://127.0.0.1:${port}${path}`, { method: 'POST', headers: headers('POST', path, body), body }) assert.equal(first.status, 202) const firstPayload = await first.json() as any - assert.equal(firstPayload.title, '【由壹点·固定资产】待审批报废') + assert.equal(firstPayload.title, '【由壹点】固定资产·待审批报废') const second = await fetch(`http://127.0.0.1:${port}${path}`, { method: 'POST', headers: headers('POST', path, body), body }) assert.equal(second.status, 200) diff --git a/src/server.ts b/src/server.ts index c09c659..2922007 100644 --- a/src/server.ts +++ b/src/server.ts @@ -108,7 +108,7 @@ export const createServer = (projects: Map) => { if (title.length > 100 || content.length > 4800 || actionTitle.length > 20) return res.status(422).json({ error: 'MESSAGE_TOO_LONG' }) if (title.startsWith('【由壹点')) return res.status(422).json({ error: 'TITLE_BRAND_RESERVED' }) - const renderedTitle = `【由壹点·${project.name}】${title}` + const renderedTitle = `【由壹点】${project.name}·${title}` const normalized = { recipientUserId, title, content, actionTitle, actionUrl } const requestHash = sha256(JSON.stringify(normalized)) const existing = await prisma.notificationDelivery.findUnique({