import { isLofter } from 'nw-detect'; export function navigate(link: string) { let reg = /^https?:\/\// if (!reg.test(link)) { window.location.href = `https://${link}` } else { window.location.href = link } } /** * 跳转URL,App内使用新webview打开,端外直接跳转 */ export function appNavigate(url: string) { if (isLofter() && url.startsWith('http')) { window.location.href = `lofter://webview?url=${encodeURIComponent(url)}&inside=true`; } else { window.location.href = url; } }