Compare commits

..

1 Commits

6 changed files with 14 additions and 70 deletions
-1
View File
@@ -218,7 +218,6 @@ npm run preview
| 现象 | 优先检查 |
| --- | --- |
| 页面能打开但提示状态或接口加载失败 | 后端是否可用;Network 中 `/api/status` 的目标地址与响应;代理配置 |
| 共享测试站出现 Vite 红色遮罩 | 检查站点网关的前端上游。共享测试站应由网关提供构建后的静态文件,Vite 开发服务仅用于联调。开发服务对 `.npmrc` 请求直接返回 404。 |
| 登录后又回到登录页 | `/api/user/self` 响应、Cookie 是否发送、跨域凭证策略、账号状态 |
| 企业数据为空或串到其他企业 | 当前组织选择、`current_org_id` 与请求头 `X-Org-Id` |
| 修改环境变量后无变化 | 是否重启开发服务或重新构建发布;HTML 与静态资源缓存 |
-16
View File
@@ -42,22 +42,6 @@
- **回滚**:还原兑换码列表、表单、详情弹窗和对应样式与文案。
- **关联**:`src/components/table/redemptions/`、`docs/ui/CONSOLE_SPEC.md`。
### 修复 · 企业成员排行的主题色与跨页名次
- **范围**:企业中心 `/org/logs` 的成员排行。
- **变更**:前三名使用主题派生的三档底色,其他名次使用中性色;在分页前生成全表名次。
- **影响**:切换系统主色或明暗模式时,排名徽章同步更新;翻页时继续显示全表名次。
- **回滚**:还原排名列的名次生成和徽章配色。
- **关联**:`src/pages/Organization/OrgLogs.jsx`、`src/styles/org-center.css`、`docs/ui/ORG_CENTER_SPEC.md`。
### 修复 · Vite 读取 npm 配置文件触发错误遮罩
- **范围**:Vite 开发服务的文件请求处理。
- **变更**:在资源转换前拦截 `.npmrc` 请求并返回 404,同时将 `.npmrc` 加入文件访问拒绝列表。
- **影响**:npm 配置文件请求不会启动资源转换或触发全站热更新错误遮罩。应用使用的文本资源导入继续由 Vite 转换。
- **回滚**:还原 Vite 的 npm 配置文件拦截和对应访问规则。
- **关联**:`vite.config.js`、`README.md`。
### 修复 · 控制台数据看板持续加载
- **范围**:控制台 `/console/analytics` 运营看板、创作作品详情抽屉及公共 API 的只读请求。
+1 -1
View File
@@ -90,7 +90,7 @@
- 时间范围为本页签自有的可编辑字段(默认最近 7 天,含快捷预设),与“明细日志”筛选互不影响;起止颠倒沿用原提示。
- 末列“操作”不固定:视频任务显示“点击预览视频”,失败任务保留失败原因查看,其余显示“-”。
- 预览视频沿用 `ContentModal`:标题栏“视频预览”与关闭按钮、16:9 播放区、加载态、播放失败或无地址时 `Empty` 空态、页脚复制链接 / 新标签页打开 / 关闭;关闭时暂停视频,重开同一视频不残留加载指示。
- 成员排行按接口返回顺序在分页前生成连续名次。行键使用 `user_id-名次序号`,避免后端同一成员多行时出现重复 key。前三名使用当前主题的强调色及三档底色,其余名次使用中性色。
- 成员排行行键使用 `user_id-名次序号`,避免后端同一成员多行时出现重复 key。
- 明细日志查询不写 URL;绘图与视频筛选沿用原有 URL 同步。
- 保留差异:明细日志无列设置、分组列、操作列;任务表无渠道 / 用户 ID 筛选、平台列、排序与任务 ID 复制。
+3 -9
View File
@@ -731,7 +731,6 @@ const OrgLogs = ({ orgId, orgRole, isDeptManager = false }) => {
() =>
(ranking || []).map((row, index) => ({
...row,
rank: index + 1,
rank_row_key: `${row.user_id ?? 'unknown'}-${index}`,
})),
[ranking],
@@ -741,15 +740,10 @@ const OrgLogs = ({ orgId, orgRole, isDeptManager = false }) => {
() => [
{
title: t('排名'),
dataIndex: 'rank',
width: 90,
render: (rank) => (
<span
className={
rank <= 3 ? `oc-exp-rank oc-exp-rank-${rank}` : 'oc-exp-rank'
}
>
{rank}
render: (_, __, index) => (
<span className={`oc-exp-rank oc-exp-rank-${index + 1}`}>
{index + 1}
</span>
),
},
+10 -14
View File
@@ -527,6 +527,10 @@ html.dark .org-center .oc-page {
--oc-stat-rose: #cf4c69;
--oc-stat-blue-bg: #2981ce10;
--oc-stat-blue: #2981ce;
--oc-rank-1: #e0ad21;
--oc-rank-2: #8795a8;
--oc-rank-3: #bc7847;
--oc-rank-text: #fff;
}
.org-center .oc-page .oc-exp-stats {
@@ -627,26 +631,18 @@ html.dark .org-center .oc-page {
}
.org-center .oc-page .oc-exp-rank-1 {
background-color: var(--brand-selection-bg);
color: var(--brand-selection-text);
background: var(--oc-rank-1);
color: var(--oc-rank-text);
}
.org-center .oc-page .oc-exp-rank-2 {
background-color: color-mix(
in srgb,
var(--brand-selection-bg) 65%,
var(--oc-soft)
);
color: var(--brand-selection-text);
background: var(--oc-rank-2);
color: var(--oc-rank-text);
}
.org-center .oc-page .oc-exp-rank-3 {
background-color: color-mix(
in srgb,
var(--brand-selection-bg) 35%,
var(--oc-soft)
);
color: var(--brand-selection-text);
background: var(--oc-rank-3);
color: var(--oc-rank-text);
}
@media (max-width: 767px) {
-29
View File
@@ -16,7 +16,6 @@ const DEV_PROXY_TARGET = 'http://134.175.227.134:13000';
*/
const JSX_IN_JS_RE = /src\/.*\.js$/;
const REACT_RUNTIME_RE = /\/node_modules\/(?:react|react-dom|scheduler)\//;
const NPM_CONFIG_PATH_RE = /(?:^|[\\/])\.npmrc[. ]*(?:[\\/]|$)/i;
/**
* 让 JSX_IN_JS_RE 命中的 .js 按 JSX 语法解析。
@@ -60,29 +59,6 @@ function disableDevImportGlob() {
};
}
function blockNpmConfigRequests() {
return {
name: 'block-npm-config-requests',
configureServer(server) {
server.middlewares.use((request, response, next) => {
let pathname;
try {
pathname = decodeURIComponent(
(request.url ?? '').split(/[?#]/, 1)[0],
);
} catch {
return next();
}
if (!NPM_CONFIG_PATH_RE.test(pathname)) return next();
// Stop before Vite tries to load the file or broadcasts an HMR error.
response.statusCode = 404;
response.end();
});
},
};
}
/**
* 向 index.html 注入统计脚本。
*
@@ -147,7 +123,6 @@ export default defineConfig(({ mode, command }) => {
},
},
plugins: [
blockNpmConfigRequests(),
disableDevImportGlob(),
jsxInJsPlugin(),
react(),
@@ -197,10 +172,6 @@ export default defineConfig(({ mode, command }) => {
// 监听局域网接口,供本机、后端及测试人员联调。
host: '0.0.0.0',
port: 5174,
fs: {
// Setting deny replaces the Vite defaults.
deny: ['.env', '.env.*', '*.{crt,pem}', '**/.git/**', '.npmrc'],
},
warmup: {
clientFiles: [
'./src/index.jsx',