feat: 增价crisp会话客服
This commit is contained in:
@@ -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) &&
|
||||
|
||||
Reference in New Issue
Block a user