func uploadImage(token: String) {
let photoData = Tools().normalResImageForAsset(photoImage, imageSize: photoImage.size)
let photoName = Tools().fileNameByUserid(self.userId())
let flag = false
let magager = QNUploadManager()
let opt = QNUploadOption.init(mime: nil, progressHandler: { (key: String!, percent: Float) -> Void in
print(percent)
}, params: nil, checkCrc: false) { () -> Bool in
return flag
}
magager.putData(photoData, key: photoName, token: token, complete: { (info: QNResponseInfo!, key: String!, resp: [NSObject : AnyObject]!) -> Void in
print("info: \(info.description) resp: \(resp)")
}, option: opt!)
}
返回信息:
info: <QNResponseInfo= id: 1443606256028115, status: -5, requestId: (null), xlog: (null), xvia: (null), host: (null) ip: (null) duration: 0.000000 s time: 1443606256 error: Error Domain=qiniu.com Code=-5 "(null)" UserInfo={error=invalid token}> resp: nil
QINIU SDK:v7.0.11.1
提工单了,回复太慢,马上放假了,尽快亲
获取的token可能错了,贴下token