Skip to content

Commit e62eeec

Browse files
author
陈潇文
committed
[frontend] 修改校验公共访问地址逻辑
1 parent 71ff840 commit e62eeec

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

frontend/src/pages/chatRunning/index.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,13 @@ const ChatRunning = () => {
179179

180180
// 校验公共访问页面地址是否访问合规
181181
const validatePage = (isGuest) => {
182-
return location.pathname.includes('/guest') ? isGuest : !isGuest;
182+
if (process.env.PACKAGE_MODE === 'spa') {
183+
return !isGuest;
184+
} else if (location.pathname.includes('/guest')) {
185+
return isGuest;
186+
} else {
187+
return true;
188+
}
183189
};
184190

185191
useEffect(() => {
@@ -192,7 +198,7 @@ const ChatRunning = () => {
192198
if (uid) {
193199
getAppGuestIsOpen(uid).then((res) => {
194200
const isGuest = res.data;
195-
if (process.env.PACKAGE_MODE === 'spa' && !validatePage(isGuest)) {
201+
if (!validatePage(isGuest)) {
196202
setWrongAddress(true);
197203
return;
198204
}

0 commit comments

Comments
 (0)