This commit is contained in:
2026-01-29 10:43:43 +08:00
commit 4a76df3391
426 changed files with 74975 additions and 0 deletions

25
utils/tool.ts Normal file
View File

@@ -0,0 +1,25 @@
export function escapeHtml(str: string) {
let temp = '';
if (str.length === 0) return '';
temp = str.replace(/&/g, '&');
temp = temp.replace(/&lt;/g, '<');
temp = temp.replace(/&gt;/g, '>');
temp = temp.replace(/&nbsp;/g, ' ');
temp = temp.replace(/&#39;/g, "'");
temp = temp.replace(/&quot;/g, '"');
return temp;
}
export function isArray(str: unknown) {
return Object.prototype.toString.call(str) === '[object Array]';
}
// 配置服务器接口
export function getBaseUrl() {
console.log('process:',process.server)
if (process.server) {
return "https://modules.gxwebsoft.com/api"
} else {
return "https://modules.gxwebsoft.com/api"
}
}