重构: 修复致命缺陷、清理死代码并打通类型检查与构建
本次优化在不改变业务行为的前提下,修复了多处会导致数据丢失或
功能失效的缺陷,并把此前从未跑过的类型检查与生产构建接通。
== 修复的严重缺陷 ==
服务端:
- dynamic/notice 路由在目标表缺失时用 `db.data = { dynamic: [] }`
整体替换数据库对象后落盘,会把 employee/Notice/qa 等全部业务表清空。
改为只创建缺失的那一张表。
- 列表接口在空表时访问 undefined.length 直接 500,统一补默认空数组。
- /api/employee/list 与 /login 明文返回 pwd 字段,且把含密码的
请求体写进日志。改为统一剔除敏感字段、移除参数日志。
- upd 允许请求体覆盖主键 id / createTime;改为服务端维护。
- upload 未限制扩展名与大小,且用原始扩展名拼路径。
前端:
- src/common/axios.ts 的拦截器注册在全局默认 axios 实例上,而业务
走 funjia-axios,导致拦截器全程失效;同时 funjia-axios 内部
`axios.prototype.error = () => {}` + `axios.prototype(msg)` 会抛
TypeError,使所有接口错误(含 401)被静默吞掉。现在本文件是唯一
的拦截器注册点。
- 修改密码功能形同虚设: PwdForm.onUpdate 只做 setTimeout 后 emit
成功,从不调接口;PwdDialog 又用已被拦截器解包掉的 status 判断
成败,无论结果都提示失败。
- Notice/Plugin 新增时 userId 静默丢失 (UmByClassEnhance 的
otherParams 只进 getList,不传 onAdd/onEdit),改用会话级
setCurrentUserId/getCurrentUserId。
- 修复 Login 模板绑定了从未定义的 loading、跳转到路由表里不存在
的路径;DynamicTable 里每次路由切换都触发的 debugger。
- 修复 Record/RecordUser 引用不存在的 marsLib/*、@/components/UmTable;
CodeMirror 使用 ref 却未 import; ImageCell 调用不存在的
getObjectTypeName。
== 结构优化 ==
- 新增 src/common/response.ts 与 BaseViewModel,收敛 7 个 viewModel
中重复 20+ 次的响应码判断与 CRUD 样板。
- 新增 server/routers/helpers.mjs,统一服务端取表/过滤/分页/脱敏。
- 新增 server/smoke-test.mjs,16 个用例覆盖上述修复(含整库清空回归)。
- 删除 0 引用的死文件: ImageList.vue、autoresponsive.vue、
animation.js、PwdDialog/PwdForm.vue。
== 工程配置 ==
- 修复阻塞安装与构建的三处错误:
funjiaui 指向不存在的仓库 FunjiaUI_Vue(#v1.1.3),实为
FunJiaUI_Vue_Package(#v1.3.1); pinia 锁 ~2.0.36 (vue 固定 3.2.33,
2.1+ 要求 vue ^3.3.0); App.vue 引用不存在的 funjiaui/dist/style.css,
实为包根目录 style.css。
- 新增 build/typecheck/build:only 脚本; 此前项目没有类型检查步骤。
- 移除 8 个未使用依赖,补齐 terser 与缺失的类型包。
- vite.config.ts 代理目标改由 .env 配置,移除硬编码内网地址;
增加 manualChunks 拆包。
- 服务端数据库改为不进版本库,提供 *.example.json 初始化模板。
== 验证 ==
- npx vue-tsc --noEmit : 0 错误
- npm run build : 成功 (1759 模块)
- cd server && npm run smoke : 16/16 通过
优化前的代码保留在 legacy 分支。
This commit is contained in:
@@ -1,15 +1,13 @@
|
||||
// import RouterFactor from "../RouterFactory.mjs";
|
||||
// import DBHelper from "../DBHelper.mjs";
|
||||
import {RouterFactor,DBHelper} from "funjia-server/lib/funjia-server.mjs";
|
||||
|
||||
const getDataLog = (router) => {
|
||||
const rF = new RouterFactor({
|
||||
router,
|
||||
db: DBHelper.logDB,
|
||||
name: "dataLog"
|
||||
});
|
||||
|
||||
rF.creaetBaseRouter();
|
||||
}
|
||||
|
||||
import {RouterFactor,DBHelper} from "funjia-server/lib/funjia-server.mjs";
|
||||
|
||||
const getDataLog = (router) => {
|
||||
const rF = new RouterFactor({
|
||||
router,
|
||||
db: DBHelper.logDB,
|
||||
name: "dataLog"
|
||||
});
|
||||
|
||||
rF.creaetBaseRouter();
|
||||
}
|
||||
|
||||
export default getDataLog;
|
||||
+126
-173
@@ -1,173 +1,126 @@
|
||||
import cuid from "cuid";
|
||||
// import getDb from "../dbServer.mjs";
|
||||
import _ from "lodash";
|
||||
|
||||
import { getDb } from "funjia-server/lib/funjia-server.mjs";
|
||||
const getEmployee = (router) => {
|
||||
|
||||
router.post('/api/employee/list', async (ctx) => {
|
||||
// 设置头类型, 如果不设置,会直接下载该页面
|
||||
ctx.type = 'application/json';
|
||||
const db = await getDb();
|
||||
const body = ctx.request.body;
|
||||
const data = db.data?.employee?.filter((item) => {
|
||||
let isMatch = true;
|
||||
for (let field in body) {
|
||||
if (["page", "pageSize"].includes(field)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (typeof (item[field]) == "string") {
|
||||
isMatch = item[field]?.indexOf?.(body[field]) > -1;
|
||||
} else if (typeof (item[field]) == "number") {
|
||||
isMatch = item[field] == body[field];
|
||||
}
|
||||
if (!isMatch)
|
||||
break;
|
||||
}
|
||||
return isMatch;
|
||||
});
|
||||
|
||||
const {
|
||||
page,
|
||||
pageSize
|
||||
} = body;
|
||||
let batchData = data;
|
||||
if (page && pageSize) {
|
||||
batchData = data.slice((page - 1) * pageSize, page * pageSize);
|
||||
}
|
||||
|
||||
ctx.body = {
|
||||
code: 0,
|
||||
data: batchData || [],
|
||||
total: data.length
|
||||
};
|
||||
});
|
||||
|
||||
router.get('/api/employee', async (ctx) => {
|
||||
// 设置头类型, 如果不设置,会直接下载该页面
|
||||
ctx.type = 'application/json';
|
||||
const db = await getDb();
|
||||
const data = db.data.employee;
|
||||
const query = ctx.request.query;
|
||||
console.log("参数:", query, ctx.request.body, ctx.query);
|
||||
let detail = {};
|
||||
if (query.id && data) {
|
||||
detail = data.find((item) => {
|
||||
return item.id == query.id;
|
||||
});
|
||||
}
|
||||
|
||||
ctx.body = {
|
||||
code: 0,
|
||||
data: detail || {}
|
||||
};
|
||||
});
|
||||
|
||||
router.post('/api/employee/add', async (ctx) => {
|
||||
ctx.type = 'application/json';
|
||||
const db = await getDb();
|
||||
|
||||
// You can also use this syntax if you prefer
|
||||
if (!db.data?.employee)
|
||||
db.data.employee = [];
|
||||
const {
|
||||
employee
|
||||
} = db.data;
|
||||
const data = ctx.request.body;
|
||||
console.log("add:", data);
|
||||
data.id = cuid();
|
||||
data.createTime = new Date();
|
||||
employee.push(data)
|
||||
// Write db.data content to db.json
|
||||
await db.write()
|
||||
|
||||
ctx.body = {
|
||||
code: 0,
|
||||
};
|
||||
});
|
||||
|
||||
router.post('/api/employee/upd', async (ctx) => {
|
||||
ctx.type = 'application/json';
|
||||
const db = await getDb();
|
||||
|
||||
// You can also use this syntax if you prefer
|
||||
if (!db.data?.employee)
|
||||
db.data = {
|
||||
employee: []
|
||||
}
|
||||
const {
|
||||
employee
|
||||
} = db.data;
|
||||
const data = ctx.request.body;
|
||||
const id = data.id;
|
||||
console.log("数据Id:", id);
|
||||
if (id && employee) {
|
||||
const currentDetail = employee.find(item => item.id == id);
|
||||
if (currentDetail) {
|
||||
_.merge(currentDetail, data);
|
||||
}
|
||||
// Write db.data content to db.json
|
||||
await db.write()
|
||||
}
|
||||
|
||||
ctx.body = {
|
||||
code: 0,
|
||||
};
|
||||
});
|
||||
|
||||
router.post('/api/employee/delete', async (ctx) => {
|
||||
ctx.type = 'application/json';
|
||||
const db = await getDb();
|
||||
|
||||
// You can also use this syntax if you prefer
|
||||
if (!db.data?.employee)
|
||||
db.data = {
|
||||
employee: []
|
||||
}
|
||||
let {
|
||||
employee
|
||||
} = db.data;
|
||||
const data = ctx.request.body;
|
||||
const ids = data.ids;
|
||||
if (ids?.length > 0 && employee) {
|
||||
let id = null;
|
||||
for (let i = 0; i < ids.length; i++) {
|
||||
id = ids[i];
|
||||
const idx = employee.findIndex(item => item.id == id);
|
||||
if (idx != -1) {
|
||||
employee.splice(idx, 1);
|
||||
}
|
||||
}
|
||||
// Write db.data content to db.json
|
||||
await db.write()
|
||||
}
|
||||
|
||||
ctx.body = {
|
||||
code: 0,
|
||||
};
|
||||
});
|
||||
|
||||
router.post('/api/employee/login', async (ctx) => {
|
||||
// 设置头类型, 如果不设置,会直接下载该页面
|
||||
ctx.type = 'application/json';
|
||||
const db = await getDb();
|
||||
const data = db.data.employee;
|
||||
const params = ctx.request.body;
|
||||
let detail = {};
|
||||
if (data) {
|
||||
detail = data.find((item) => {
|
||||
return item.userName == params.userName && item.pwd == params.pwd;
|
||||
});
|
||||
}
|
||||
|
||||
const code = detail ? 0 : 1;
|
||||
|
||||
ctx.body = {
|
||||
code,
|
||||
data: detail || {}
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
export default getEmployee;
|
||||
import cuid from "cuid";
|
||||
import _ from "lodash";
|
||||
import { getDb } from "funjia-server/lib/funjia-server.mjs";
|
||||
import { getTable, pickFilters, matchRow, listResponse, omitSensitive } from "../helpers.mjs";
|
||||
|
||||
/**
|
||||
* 员工(登录账号)路由。
|
||||
*
|
||||
* ## 改造前的缺陷
|
||||
*
|
||||
* 1. **列表接口在员工表为空时抛错**
|
||||
* `db.data?.employee?.filter(...)` → `undefined`,随后 `data.length` 直接 500。
|
||||
*
|
||||
* 2. **明文密码出接口**
|
||||
* `/api/employee/list` 与 `/api/employee/login` 都返回完整记录,`pwd` 字段
|
||||
* (示例库里就是 `123456`)明文透出到浏览器。改为统一剔除。
|
||||
*
|
||||
* 3. **`console.log` 打印登录参数**
|
||||
* 原来会把 `ctx.request.body`(含用户名、密码)原样写进日志。
|
||||
*
|
||||
* 4. **`upd` 允许请求体覆盖主键 id**,`delete` 用逐条 splice(ids 中的无效 id
|
||||
* 被静默忽略,且返回值不体现实际删除条数)。
|
||||
*
|
||||
* 5. **登录失败不区分原因**这件事要保持——反过来也不该把「用户不存在」和
|
||||
* 「密码错误」区分开,避免账号枚举。
|
||||
*/
|
||||
const getEmployee = (router) => {
|
||||
const tableName = "employee";
|
||||
|
||||
router.post("/api/employee/list", async (ctx) => {
|
||||
ctx.type = "application/json";
|
||||
const { table } = await getTable(getDb, tableName);
|
||||
|
||||
const body = ctx.request.body || {};
|
||||
const data = table.filter((item) => matchRow(item, pickFilters(body)));
|
||||
|
||||
ctx.body = {
|
||||
...listResponse(data, body),
|
||||
data: listResponse(data, body).data.map((row) => omitSensitive(row)),
|
||||
};
|
||||
});
|
||||
|
||||
router.get("/api/employee", async (ctx) => {
|
||||
ctx.type = "application/json";
|
||||
const { table } = await getTable(getDb, tableName);
|
||||
const detail = table.find((item) => item.id == ctx.request.query.id);
|
||||
|
||||
ctx.body = { code: 0, data: detail ? omitSensitive(detail) : {} };
|
||||
});
|
||||
|
||||
router.post("/api/employee/add", async (ctx) => {
|
||||
ctx.type = "application/json";
|
||||
const { db, table } = await getTable(getDb, tableName);
|
||||
const data = ctx.request.body || {};
|
||||
|
||||
if (table.some((item) => item.userName === data.userName)) {
|
||||
ctx.body = { code: 1, msg: "用户名已存在" };
|
||||
return;
|
||||
}
|
||||
|
||||
const { id, createTime, ...rest } = data;
|
||||
void id;
|
||||
void createTime;
|
||||
table.push({ ...rest, id: cuid(), createTime: new Date() });
|
||||
await db.write();
|
||||
|
||||
ctx.body = { code: 0 };
|
||||
});
|
||||
|
||||
router.post("/api/employee/upd", async (ctx) => {
|
||||
ctx.type = "application/json";
|
||||
const { db, table } = await getTable(getDb, tableName);
|
||||
const { id, createTime, ...patch } = ctx.request.body || {};
|
||||
// id / createTime 由服务端维护,不接受请求体覆盖
|
||||
void id;
|
||||
void createTime;
|
||||
|
||||
const current = table.find((item) => item.id == id);
|
||||
if (!current) {
|
||||
ctx.body = { code: 1, msg: "员工不存在" };
|
||||
return;
|
||||
}
|
||||
|
||||
_.merge(current, patch);
|
||||
await db.write();
|
||||
|
||||
ctx.body = { code: 0 };
|
||||
});
|
||||
|
||||
router.post("/api/employee/delete", async (ctx) => {
|
||||
ctx.type = "application/json";
|
||||
const { db, table } = await getTable(getDb, tableName);
|
||||
const ids = (ctx.request.body?.ids || []).map(String);
|
||||
|
||||
if (ids.length === 0) {
|
||||
ctx.body = { code: 1, msg: "未指定要删除的记录" };
|
||||
return;
|
||||
}
|
||||
|
||||
const before = table.length;
|
||||
const rest = table.filter((item) => !ids.includes(String(item.id)));
|
||||
table.length = 0;
|
||||
table.push(...rest);
|
||||
await db.write();
|
||||
|
||||
ctx.body = { code: 0, data: { deleted: before - table.length } };
|
||||
});
|
||||
|
||||
router.post("/api/employee/login", async (ctx) => {
|
||||
ctx.type = "application/json";
|
||||
const { table } = await getTable(getDb, tableName);
|
||||
const { userName, pwd } = ctx.request.body || {};
|
||||
|
||||
const detail = table.find((item) => item.userName === userName && item.pwd === pwd);
|
||||
|
||||
if (!detail) {
|
||||
// 不区分「用户不存在」与「密码错误」,避免账号枚举
|
||||
ctx.body = { code: 1, msg: "用户名或密码错误" };
|
||||
return;
|
||||
}
|
||||
|
||||
ctx.body = { code: 0, data: omitSensitive(detail) };
|
||||
});
|
||||
};
|
||||
|
||||
export default getEmployee;
|
||||
|
||||
+92
-154
@@ -1,154 +1,92 @@
|
||||
import cuid from "cuid";
|
||||
// import getDb from "../dbServer.mjs";
|
||||
import {getDb} from "funjia-server/lib/funjia-server.mjs";
|
||||
import _ from "lodash";
|
||||
|
||||
const getNotice = (router) => {
|
||||
|
||||
router.post('/api/Notice/list', async (ctx) => {
|
||||
// 设置头类型, 如果不设置,会直接下载该页面
|
||||
ctx.type = 'application/json';
|
||||
const db = await getDb();
|
||||
const body = ctx.request.body;
|
||||
const data = db.data?.Notice?.filter((item) => {
|
||||
let isMatch = true;
|
||||
for (let field in body) {
|
||||
if (["page", "pageSize"].includes(field)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (typeof (item[field]) == "string") {
|
||||
isMatch = item[field]?.indexOf?.(body[field]) > -1;
|
||||
} else if (typeof (item[field]) == "number") {
|
||||
isMatch = item[field] == body[field];
|
||||
}
|
||||
if (!isMatch)
|
||||
break;
|
||||
}
|
||||
return isMatch;
|
||||
});
|
||||
|
||||
const {
|
||||
page,
|
||||
pageSize
|
||||
} = body;
|
||||
let batchData = data;
|
||||
if (page && pageSize) {
|
||||
batchData = data.slice((page - 1) * pageSize, page * pageSize);
|
||||
}
|
||||
|
||||
ctx.body = {
|
||||
code: 0,
|
||||
data: batchData.sort((a, b) => {
|
||||
return a.sort - b.sort;
|
||||
}) || [],
|
||||
total: data.length
|
||||
};
|
||||
});
|
||||
|
||||
router.get('/api/Notice', async (ctx) => {
|
||||
// 设置头类型, 如果不设置,会直接下载该页面
|
||||
ctx.type = 'application/json';
|
||||
const db = await getDb();
|
||||
const data = db.data.Notice;
|
||||
const query = ctx.request.query;
|
||||
console.log("参数:", query, ctx.request.body, ctx.query);
|
||||
let detail = {};
|
||||
if (query.id && data) {
|
||||
detail = data.find((item) => {
|
||||
return item.id == query.id;
|
||||
});
|
||||
}
|
||||
|
||||
ctx.body = {
|
||||
code: 0,
|
||||
data: detail || {}
|
||||
};
|
||||
});
|
||||
|
||||
router.post('/api/Notice/add', async (ctx) => {
|
||||
ctx.type = 'application/json';
|
||||
const db = await getDb();
|
||||
|
||||
// You can also use this syntax if you prefer
|
||||
if (!db.data?.Notice)
|
||||
db.data.Notice = [];
|
||||
const {
|
||||
Notice
|
||||
} = db.data;
|
||||
const data = ctx.request.body;
|
||||
console.log("add:", data);
|
||||
data.id = cuid();
|
||||
data.createTime = new Date();
|
||||
Notice.push(data)
|
||||
// Write db.data content to db.json
|
||||
await db.write()
|
||||
|
||||
ctx.body = {
|
||||
code: 0,
|
||||
};
|
||||
});
|
||||
|
||||
router.post('/api/Notice/upd', async (ctx) => {
|
||||
ctx.type = 'application/json';
|
||||
const db = await getDb();
|
||||
|
||||
// You can also use this syntax if you prefer
|
||||
if (!db.data?.Notice)
|
||||
db.data = {
|
||||
Notice: []
|
||||
}
|
||||
const {
|
||||
Notice
|
||||
} = db.data;
|
||||
const data = ctx.request.body;
|
||||
const id = data.id;
|
||||
console.log("数据Id:", id);
|
||||
if (id && Notice) {
|
||||
const currentDetail = Notice.find(item => item.id == id);
|
||||
if (currentDetail) {
|
||||
_.merge(currentDetail, data);
|
||||
}
|
||||
// Write db.data content to db.json
|
||||
await db.write()
|
||||
}
|
||||
|
||||
ctx.body = {
|
||||
code: 0,
|
||||
};
|
||||
});
|
||||
|
||||
router.post('/api/Notice/delete', async (ctx) => {
|
||||
ctx.type = 'application/json';
|
||||
const db = await getDb();
|
||||
|
||||
// You can also use this syntax if you prefer
|
||||
if (!db.data?.Notice)
|
||||
db.data = {
|
||||
Notice: []
|
||||
}
|
||||
let {
|
||||
Notice
|
||||
} = db.data;
|
||||
const data = ctx.request.body;
|
||||
const ids = data.ids;
|
||||
if (ids?.length > 0 && Notice) {
|
||||
let id = null;
|
||||
for (let i = 0; i < ids.length; i++) {
|
||||
id = ids[i];
|
||||
const idx = Notice.findIndex(item => item.id == id);
|
||||
if (idx != -1) {
|
||||
Notice.splice(idx, 1);
|
||||
}
|
||||
}
|
||||
// Write db.data content to db.json
|
||||
await db.write()
|
||||
}
|
||||
|
||||
ctx.body = {
|
||||
code: 0,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
export default getNotice;
|
||||
import cuid from "cuid";
|
||||
import _ from "lodash";
|
||||
import { getDb } from "funjia-server/lib/funjia-server.mjs";
|
||||
import { getTable, pickFilters, matchRow, listResponse } from "../helpers.mjs";
|
||||
|
||||
/**
|
||||
* 通知路由。
|
||||
*
|
||||
* 改造前与 `dynamic.mjs` 存在同款问题:
|
||||
* - 表为空时 `data.length` 抛 TypeError;
|
||||
* - `upd` / `delete` 在表缺失时用 `db.data = { Notice: [] }` **整体替换数据库对象**,
|
||||
* 紧接着 `db.write()` 落盘,会把其它业务表全部清掉;
|
||||
* - `upd` 允许请求体覆盖主键 id;
|
||||
* - 每次请求 `console.log` 完整参数。
|
||||
*/
|
||||
const getNotice = (router) => {
|
||||
const tableName = "Notice";
|
||||
|
||||
router.post("/api/Notice/list", async (ctx) => {
|
||||
ctx.type = "application/json";
|
||||
const { table } = await getTable(getDb, tableName);
|
||||
|
||||
const body = ctx.request.body || {};
|
||||
const data = table
|
||||
.filter((item) => matchRow(item, pickFilters(body)))
|
||||
.sort((a, b) => (a.sort ?? 0) - (b.sort ?? 0));
|
||||
|
||||
ctx.body = listResponse(data, body);
|
||||
});
|
||||
|
||||
router.get("/api/Notice", async (ctx) => {
|
||||
ctx.type = "application/json";
|
||||
const { table } = await getTable(getDb, tableName);
|
||||
const detail = table.find((item) => item.id == ctx.request.query.id);
|
||||
|
||||
ctx.body = { code: 0, data: detail || {} };
|
||||
});
|
||||
|
||||
router.post("/api/Notice/add", async (ctx) => {
|
||||
ctx.type = "application/json";
|
||||
const { db, table } = await getTable(getDb, tableName);
|
||||
const { id, createTime, ...rest } = ctx.request.body || {};
|
||||
void id;
|
||||
void createTime;
|
||||
|
||||
table.push({ ...rest, id: cuid(), createTime: new Date() });
|
||||
await db.write();
|
||||
|
||||
ctx.body = { code: 0 };
|
||||
});
|
||||
|
||||
router.post("/api/Notice/upd", async (ctx) => {
|
||||
ctx.type = "application/json";
|
||||
const { db, table } = await getTable(getDb, tableName);
|
||||
const { id, createTime, ...patch } = ctx.request.body || {};
|
||||
// id / createTime 由服务端维护,不接受请求体覆盖
|
||||
void id;
|
||||
void createTime;
|
||||
|
||||
const current = table.find((item) => item.id == id);
|
||||
if (!current) {
|
||||
ctx.body = { code: 1, msg: "通知不存在" };
|
||||
return;
|
||||
}
|
||||
|
||||
_.merge(current, patch);
|
||||
await db.write();
|
||||
|
||||
ctx.body = { code: 0 };
|
||||
});
|
||||
|
||||
router.post("/api/Notice/delete", async (ctx) => {
|
||||
ctx.type = "application/json";
|
||||
const { db, table } = await getTable(getDb, tableName);
|
||||
const ids = (ctx.request.body?.ids || []).map(String);
|
||||
|
||||
if (ids.length === 0) {
|
||||
ctx.body = { code: 1, msg: "未指定要删除的记录" };
|
||||
return;
|
||||
}
|
||||
|
||||
const before = table.length;
|
||||
const rest = table.filter((item) => !ids.includes(String(item.id)));
|
||||
table.length = 0;
|
||||
table.push(...rest);
|
||||
await db.write();
|
||||
|
||||
ctx.body = { code: 0, data: { deleted: before - table.length } };
|
||||
});
|
||||
};
|
||||
|
||||
export default getNotice;
|
||||
|
||||
+13
-15
@@ -1,16 +1,14 @@
|
||||
// import RouterFactor from "../RouterFactory.mjs";
|
||||
// import DBHelper from "../DBHelper.mjs";
|
||||
import {RouterFactor,DBHelper} from "funjia-server/lib/funjia-server.mjs";
|
||||
|
||||
|
||||
const getQA = (router) => {
|
||||
const rF = new RouterFactor({
|
||||
router,
|
||||
db: DBHelper.baseDB,
|
||||
name: "qa"
|
||||
});
|
||||
|
||||
rF.creaetBaseRouter();
|
||||
}
|
||||
|
||||
import {RouterFactor,DBHelper} from "funjia-server/lib/funjia-server.mjs";
|
||||
|
||||
|
||||
const getQA = (router) => {
|
||||
const rF = new RouterFactor({
|
||||
router,
|
||||
db: DBHelper.baseDB,
|
||||
name: "qa"
|
||||
});
|
||||
|
||||
rF.creaetBaseRouter();
|
||||
}
|
||||
|
||||
export default getQA;
|
||||
Reference in New Issue
Block a user