You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
673 B
25 lines
673 B
export function escapeHtml(str: string) {
|
|
let temp = '';
|
|
if (str.length === 0) return '';
|
|
temp = str.replace(/&/g, '&');
|
|
temp = temp.replace(/</g, '<');
|
|
temp = temp.replace(/>/g, '>');
|
|
temp = temp.replace(/ /g, ' ');
|
|
temp = temp.replace(/'/g, "'");
|
|
temp = temp.replace(/"/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 "http://127.0.0.1:9001/api"
|
|
} else {
|
|
return "https://modules.gxwebsoft.com/api"
|
|
}
|
|
}
|