feat: 增价crisp会话客服

This commit is contained in:
2025-08-26 08:59:37 -07:00
parent 6b8f828277
commit 632cb85ad3
5 changed files with 71 additions and 2 deletions
+3 -1
View File
@@ -1,5 +1,6 @@
import { locales, NEXT_PUBLIC_DEFAULT_LANGUAGE } from '@/config/constants';
import { isBrowser } from '@workspace/airo-ui/utils';
import { Crisp } from 'crisp-sdk-web';
import { UAParser } from 'ua-parser-js';
import Cookies from 'universal-cookie';
@@ -45,10 +46,11 @@ export function getRedirectUrl() {
sessionStorage.removeItem('redirect-url');
return url;
}
export function Logout() {
if (!isBrowser()) return;
cookies.remove('Authorization');
Crisp.setTokenId(); // 1. Clear the token value
Crisp.session.reset(); // 2. Unbind the current session
const pathname = location.pathname;
if (
!['', '/', '/auth', '/tos', '/privacy-policy'].includes(pathname) &&