解决: 在string传入前,需要转码操作. url = URL(string: urlPath.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!) 参考链接