api更改
deploy-userbase-front / build-and-deploy (push) Successful in 3m23s

This commit is contained in:
chenxing
2026-08-19 00:19:03 +08:00
parent 5247515a85
commit a096948371
5 changed files with 247 additions and 211 deletions
+14
View File
@@ -0,0 +1,14 @@
const fs = require('fs');
const base = 'D:/SoftProject/yunhai/UserBase/front/src/api/';
const files = ['apiDefinitions.ts', 'globals.d.ts'];
// 仅匹配单引号包裹的 api-path key:'xxxController.method'
const re = /'([a-zA-Z]+?)Controller\./g;
for (const f of files) {
const p = base + f;
let s = fs.readFileSync(p, 'utf8');
const before = (s.match(re) || []).length;
s = s.replace(re, (m, ns) => "'" + ns.charAt(0).toUpperCase() + ns.slice(1) + ".");
fs.writeFileSync(p, s, 'utf8');
const after = (s.match(re) || []).length;
console.log(f + ': replaced ' + before + ' -> remaining ' + after);
}
+9
View File
@@ -0,0 +1,9 @@
const fs = require('fs');
const p = 'D:/SoftProject/yunhai/UserBase/front/src/api/globals.d.ts';
let s = fs.readFileSync(p, 'utf8');
// 匹配类型侧命名空间属性声明: baseController: { 或 baseController?: {
const re = /([ \t])([a-zA-Z]+?)Controller(\s*\??):/g;
const before = (s.match(re) || []).length;
s = s.replace(re, (m, sp, ns, q) => sp + (ns.charAt(0).toUpperCase() + ns.slice(1)) + (q || '') + ':');
fs.writeFileSync(p, s, 'utf8');
console.log('globals prop decl converted: ' + before + ' -> ' + (s.match(re) || []).length + ' remaining');