feat: 判断内网状态

This commit is contained in:
“张嘉宁” 2023-04-04 14:43:43 +08:00
parent 7af9f26aae
commit 5e10cc7411

View File

@ -611,6 +611,7 @@ export function Home() {
const [isAllow, setIsAllow] = useState(false); // 白名单状态
const [isRequestErr, setIsRequestErr] = useState(false); // 接口报错状态
const [isLoading, setIsLoading] = useState(false);
const [isNotInLan, setIsNotInLan] = useState(false); // 不在内网
useEffect(() => {
getBaseInfo()
@ -631,6 +632,7 @@ export function Home() {
} else {
const { code, msg } = data;
setIsAllow(code === 0);
setIsNotInLan(code === 403);
}
setIsLoading(false)
}
@ -692,7 +694,11 @@ export function Home() {
// 接口报错
isRequestErr ? (
<h2>~</h2>
) : // 不在企业微信
) :
// 不在内网
isNotInLan ?
<h2>使线ZKT-Office或VPN连接</h2> :
// 不在企业微信
!isWorkWechat() ? (
<h2 className={styles['not-wx-work']}>使ChatGPT,----ChatGPT</h2>
) : // 不在白名单