mirror of
https://github.com/labring/FastGPT.git
synced 2026-04-04 01:01:14 +08:00
feat: share unlogin.perf: link format and model ui
This commit is contained in:
@@ -115,8 +115,12 @@ export const voiceBroadcast = ({ text }: { text: string }) => {
|
||||
};
|
||||
};
|
||||
|
||||
export const formatLinkTextToHtml = (text: string) => {
|
||||
export const formatLinkText = (text: string) => {
|
||||
const httpReg =
|
||||
/(http|https|ftp):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?/gi;
|
||||
return text.replace(httpReg, '<a href="$&" target="_blank">$&</a>');
|
||||
return text.replace(httpReg, ` $& `);
|
||||
};
|
||||
|
||||
export const getErrText = (err: any, def = '') => {
|
||||
return typeof err === 'string' ? err : err?.message || def;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user