mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 13:03:50 +00:00
V4.6.7-production (#759)
This commit is contained in:
@@ -38,6 +38,12 @@ export function replaceVariable(text: string, obj: Record<string, string | numbe
|
||||
return text || '';
|
||||
}
|
||||
|
||||
/* replace sensitive link */
|
||||
export const replaceSensitiveLink = (text: string) => {
|
||||
const urlRegex = /(?<=https?:\/\/)[^\s]+/g;
|
||||
return text.replace(urlRegex, 'xxx');
|
||||
};
|
||||
|
||||
export const getNanoid = (size = 12) => {
|
||||
return customAlphabet('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890', size)();
|
||||
};
|
||||
|
Reference in New Issue
Block a user