Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5adb6eaec3 | |||
| 0f0aebe3a4 | |||
| b1c5610f23 | |||
| 1d045b7770 | |||
| a07ba77c5a |
@@ -128,3 +128,7 @@ pnpm start:prod
|
|||||||
- `src/app/api/digital/[...path]/route.ts`:白名单 BFF,只转发前台接口,禁止访问后台实验管理,写入校验同源。
|
- `src/app/api/digital/[...path]/route.ts`:白名单 BFF,只转发前台接口,禁止访问后台实验管理,写入校验同源。
|
||||||
- 实验控制仅在 role-admin。前台没有切换实验或分组入口。
|
- 实验控制仅在 role-admin。前台没有切换实验或分组入口。
|
||||||
- `DEEPSEEK_API_KEY` 仅在业务后端配置,前端不读取、不保存。
|
- `DEEPSEEK_API_KEY` 仅在业务后端配置,前端不读取、不保存。
|
||||||
|
|
||||||
|
标签页图标采用 `public/stellar-icon-v2.svg`,同时提供多尺寸 `favicon.ico`、180/192/512 PNG,覆盖浏览器、Apple 主屏幕和 PWA。版本化资源路径用于刷新旧图标缓存。
|
||||||
|
|
||||||
|
通用实验消费者可经 `GET /api/digital/decisions/:key` 读取本人类型决策的 `data.value`,沿用 HttpOnly 会话与不缓存策略。类型、测试方案和用户分组全部在后台管理;新类型需要应用真实使用返回值并完成后台接入验收后才可启动。
|
||||||
|
|||||||
|
After Width: | Height: | Size: 5.3 KiB |
@@ -1 +1 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><rect width="64" height="64" rx="17" fill="#171219"/><defs><linearGradient id="a" x2="1" y2="1"><stop stop-color="#e0b888"/><stop offset="1" stop-color="#fcaee4"/></linearGradient></defs><path d="M32 8C35 24 40 29 56 32 40 35 35 40 32 56 29 40 24 35 8 32 24 29 29 24 32 8Z" fill="url(#a)"/><circle cx="50" cy="13" r="3" fill="#fcaee4"/></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><defs><linearGradient id="stellar" x1="12" y1="13" x2="49" y2="49" gradientUnits="userSpaceOnUse"><stop stop-color="#F4D5A3"/><stop offset="1" stop-color="#F5A8D9"/></linearGradient></defs><rect x="2" y="2" width="60" height="60" rx="18" fill="#211628"/><path d="M24 14h16c9 0 15 6 15 15v4c0 9-6 15-15 15H27L14 54l3-13c-4-3-6-7-6-12 0-9 5-15 13-15Z" fill="url(#stellar)"/><path d="M33 20c2.2 6.5 4.5 8.8 11 11-6.5 2.2-8.8 4.5-11 11-2.2-6.5-4.5-8.8-11-11 6.5-2.2 8.8-4.5 11-11Z" fill="#211628"/><circle cx="51" cy="13" r="5" fill="#F7B7DD" stroke="#211628" stroke-width="3"/></svg>
|
||||||
|
Before Width: | Height: | Size: 402 B After Width: | Height: | Size: 640 B |
|
After Width: | Height: | Size: 6.1 KiB |
|
After Width: | Height: | Size: 6.2 KiB |
|
After Width: | Height: | Size: 22 KiB |
@@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><defs><linearGradient id="stellar" x1="12" y1="13" x2="49" y2="49" gradientUnits="userSpaceOnUse"><stop stop-color="#F4D5A3"/><stop offset="1" stop-color="#F5A8D9"/></linearGradient></defs><rect x="2" y="2" width="60" height="60" rx="18" fill="#211628"/><path d="M24 14h16c9 0 15 6 15 15v4c0 9-6 15-15 15H27L14 54l3-13c-4-3-6-7-6-12 0-9 5-15 13-15Z" fill="url(#stellar)"/><path d="M33 20c2.2 6.5 4.5 8.8 11 11-6.5 2.2-8.8 4.5-11 11-2.2-6.5-4.5-8.8-11-11 6.5-2.2 8.8-4.5 11-11Z" fill="#211628"/><circle cx="51" cy="13" r="5" fill="#F7B7DD" stroke="#211628" stroke-width="3"/></svg>
|
||||||
|
After Width: | Height: | Size: 640 B |
@@ -33,11 +33,13 @@ async function proxy(
|
|||||||
const { path } = await context.params;
|
const { path } = await context.params;
|
||||||
const joined = path.join("/");
|
const joined = path.join("/");
|
||||||
if (
|
if (
|
||||||
!/^(bootstrap|profile|exposure|conversations(?:\/[a-zA-Z0-9_-]+(?:\/(?:stream|stop|branch|messages\/[a-zA-Z0-9_-]+))?)?)$/.test(
|
!/^(bootstrap|profile|exposure|decisions\/[a-zA-Z0-9_-]+|conversations(?:\/[a-zA-Z0-9_-]+(?:\/(?:stream|stop|branch|messages\/[a-zA-Z0-9_-]+))?)?)$/.test(
|
||||||
joined,
|
joined,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
return Response.json({ message: "接口不存在" }, { status: 404 });
|
return Response.json({ message: "接口不存在" }, { status: 404 });
|
||||||
|
if (joined.startsWith("decisions/") && request.method !== "GET")
|
||||||
|
return Response.json({ message: "仅支持读取决策" }, {status:405,headers:{Allow:"GET"}});
|
||||||
if (request.method !== "GET") {
|
if (request.method !== "GET") {
|
||||||
const origin = request.headers.get("origin");
|
const origin = request.headers.get("origin");
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -11,8 +11,11 @@ export const metadata: Metadata = {
|
|||||||
description: "与有故事的人相遇,让每一段对话继续生长",
|
description: "与有故事的人相遇,让每一段对话继续生长",
|
||||||
manifest: "/manifest.webmanifest",
|
manifest: "/manifest.webmanifest",
|
||||||
icons: {
|
icons: {
|
||||||
icon: "/icon.svg",
|
icon: [
|
||||||
apple: "/icon.svg",
|
{ url: "/stellar-icon-v2.svg", type: "image/svg+xml" },
|
||||||
|
{ url: "/favicon.ico?v=stellar-2", sizes: "any" },
|
||||||
|
],
|
||||||
|
apple: "/stellar-icon-180-v2.png",
|
||||||
},
|
},
|
||||||
appleWebApp: {
|
appleWebApp: {
|
||||||
capable: true,
|
capable: true,
|
||||||
|
|||||||
@@ -12,8 +12,10 @@ export default function manifest(): MetadataRoute.Manifest {
|
|||||||
background_color: "#141218",
|
background_color: "#141218",
|
||||||
theme_color: "#141218",
|
theme_color: "#141218",
|
||||||
icons: [
|
icons: [
|
||||||
|
{ src: "/stellar-icon-192-v2.png", sizes: "192x192", type: "image/png" },
|
||||||
|
{ src: "/stellar-icon-512-v2.png", sizes: "512x512", type: "image/png" },
|
||||||
{
|
{
|
||||||
src: "/icon.svg",
|
src: "/stellar-icon-v2.svg",
|
||||||
sizes: "any",
|
sizes: "any",
|
||||||
type: "image/svg+xml",
|
type: "image/svg+xml",
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1452,25 +1452,60 @@ export function DigitalHome({
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
<label>
|
<fieldset className="dh-style-picker">
|
||||||
叙事风格
|
<legend>叙事风格</legend>
|
||||||
<select
|
<p className="dh-style-help">为这段故事选一种氛围</p>
|
||||||
value={settings.presetId ?? ""}
|
<div className="dh-style-options">
|
||||||
onChange={(e) =>
|
{[
|
||||||
setSettings({
|
{
|
||||||
...settings,
|
id: "",
|
||||||
presetId: e.target.value || undefined,
|
name: "角色默认风格",
|
||||||
})
|
description: "沿用角色原有的语气与叙事节奏。",
|
||||||
}
|
},
|
||||||
>
|
...presets,
|
||||||
<option value="">角色默认风格</option>
|
...(settings.presetId &&
|
||||||
{presets.map((p) => (
|
!presets.some((p) => p.id === settings.presetId)
|
||||||
<option key={p.id} value={p.id}>
|
? [
|
||||||
{p.name}
|
{
|
||||||
</option>
|
id: settings.presetId,
|
||||||
|
name: "当前会话风格",
|
||||||
|
description:
|
||||||
|
"此风格暂不在可选列表中,可以保留或选择其他风格。",
|
||||||
|
},
|
||||||
|
]
|
||||||
|
: []),
|
||||||
|
].map((p) => (
|
||||||
|
<label className="dh-style-option" key={p.id}>
|
||||||
|
<input
|
||||||
|
type="radio"
|
||||||
|
name="conversation-preset"
|
||||||
|
value={p.id}
|
||||||
|
checked={(settings.presetId ?? "") === p.id}
|
||||||
|
onChange={() =>
|
||||||
|
setSettings({
|
||||||
|
...settings,
|
||||||
|
presetId: p.id || undefined,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<span className="dh-style-card">
|
||||||
|
<span className="dh-style-symbol" aria-hidden="true">
|
||||||
|
{p.id ? <WandSparkles /> : <Sparkles />}
|
||||||
|
</span>
|
||||||
|
<span className="dh-style-copy">
|
||||||
|
<strong>{p.name}</strong>
|
||||||
|
<small>
|
||||||
|
{p.description || "以这套风格继续你们的故事。"}
|
||||||
|
</small>
|
||||||
|
</span>
|
||||||
|
<span className="dh-style-check" aria-hidden="true">
|
||||||
|
<Check />
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</label>
|
||||||
))}
|
))}
|
||||||
</select>
|
</div>
|
||||||
</label>
|
</fieldset>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>加入世界书</legend>
|
<legend>加入世界书</legend>
|
||||||
{books.map((b) => (
|
{books.map((b) => (
|
||||||
|
|||||||
@@ -886,6 +886,132 @@
|
|||||||
color: var(--dh-muted);
|
color: var(--dh-muted);
|
||||||
padding: 0 6px;
|
padding: 0 6px;
|
||||||
}
|
}
|
||||||
|
/* 保留原生单选的键盘与读屏语义,整张风格卡可点击且随双主题变色。 */
|
||||||
|
.dh-settings .dh-style-picker {
|
||||||
|
min-width: 0;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0 0 22px;
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
.dh-style-picker legend {
|
||||||
|
padding: 0;
|
||||||
|
color: #d4cbd5;
|
||||||
|
}
|
||||||
|
.dh-style-help {
|
||||||
|
margin: 5px 0 12px !important;
|
||||||
|
color: var(--dh-muted);
|
||||||
|
font-size: 11px;
|
||||||
|
}
|
||||||
|
.dh-style-options {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
.dh-style-option {
|
||||||
|
position: relative;
|
||||||
|
min-width: 0;
|
||||||
|
cursor: pointer;
|
||||||
|
-webkit-tap-highlight-color: transparent;
|
||||||
|
}
|
||||||
|
.dh-style-option:first-child,
|
||||||
|
.dh-style-option:last-child:nth-child(even) {
|
||||||
|
grid-column: 1 / -1;
|
||||||
|
}
|
||||||
|
.dh-style-option > input {
|
||||||
|
position: absolute;
|
||||||
|
width: 1px;
|
||||||
|
height: 1px;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
opacity: 0;
|
||||||
|
clip-path: inset(50%);
|
||||||
|
}
|
||||||
|
.dh-style-card {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 10px;
|
||||||
|
height: 100%;
|
||||||
|
min-height: 88px;
|
||||||
|
padding: 15px 13px;
|
||||||
|
border: 1px solid #ffffff17;
|
||||||
|
border-radius: 13px;
|
||||||
|
background: color-mix(in srgb, var(--dh-soft) 60%, var(--dh-panel));
|
||||||
|
transition:
|
||||||
|
border-color 160ms,
|
||||||
|
background 160ms;
|
||||||
|
}
|
||||||
|
.dh-style-option:hover .dh-style-card {
|
||||||
|
border-color: color-mix(in srgb, var(--dh-accent) 55%, transparent);
|
||||||
|
}
|
||||||
|
.dh-style-option > input:checked + .dh-style-card {
|
||||||
|
border-color: var(--dh-accent);
|
||||||
|
background: color-mix(in srgb, var(--dh-accent) 9%, var(--dh-panel));
|
||||||
|
}
|
||||||
|
.dh-style-option > input:focus-visible + .dh-style-card {
|
||||||
|
outline: 2px solid var(--dh-accent);
|
||||||
|
outline-offset: 3px;
|
||||||
|
}
|
||||||
|
.dh-style-symbol {
|
||||||
|
display: grid;
|
||||||
|
flex: none;
|
||||||
|
place-items: center;
|
||||||
|
width: 29px;
|
||||||
|
height: 29px;
|
||||||
|
color: var(--dh-accent);
|
||||||
|
background: color-mix(in srgb, var(--dh-accent) 10%, transparent);
|
||||||
|
border-radius: 9px;
|
||||||
|
}
|
||||||
|
.dh-style-symbol svg {
|
||||||
|
width: 15px;
|
||||||
|
height: 15px;
|
||||||
|
}
|
||||||
|
.dh-style-copy {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
overflow-wrap: anywhere;
|
||||||
|
}
|
||||||
|
.dh-style-copy strong {
|
||||||
|
display: block;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 600;
|
||||||
|
line-height: 1.6;
|
||||||
|
}
|
||||||
|
.dh-style-copy small {
|
||||||
|
display: block;
|
||||||
|
margin-top: 5px;
|
||||||
|
color: var(--dh-muted);
|
||||||
|
font-size: 11px;
|
||||||
|
line-height: 1.7;
|
||||||
|
}
|
||||||
|
.dh-style-check {
|
||||||
|
display: grid;
|
||||||
|
flex: none;
|
||||||
|
place-items: center;
|
||||||
|
width: 17px;
|
||||||
|
height: 17px;
|
||||||
|
margin-top: 2px;
|
||||||
|
color: transparent;
|
||||||
|
border: 1px solid #ffffff30;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
.dh-style-check svg {
|
||||||
|
width: 11px;
|
||||||
|
height: 11px;
|
||||||
|
stroke-width: 3;
|
||||||
|
}
|
||||||
|
.dh-style-option > input:checked + .dh-style-card .dh-style-check {
|
||||||
|
color: var(--dh-accent-ink);
|
||||||
|
background: var(--dh-accent);
|
||||||
|
border-color: var(--dh-accent);
|
||||||
|
}
|
||||||
|
@media (width <= 600px) {
|
||||||
|
.dh-style-options {
|
||||||
|
grid-template-columns: minmax(0, 1fr);
|
||||||
|
}
|
||||||
|
.dh-style-card {
|
||||||
|
min-height: 76px;
|
||||||
|
}
|
||||||
|
}
|
||||||
.dh-checkbox {
|
.dh-checkbox {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
|
|||||||