/** * * 只允许lofter.com和163.com的url */ export function isSafeUrl (url?: string) { return typeof url === 'string' && /^http(s)?:\/\/([\w.-]*\.)?(lofter|163|126|yeah|188|youdao|netease)\.com(\/|$)/.test(url) }