authUpload static method
带权限的upload
Implementation
static Future<WitsystemError> authUpload(String url, List<File> list) async {
String nonceStr = StringUtil.getRandomString(16);
int timeStamp = DateTime.now().millisecondsSinceEpoch;
String body = {}.toString();
String str = WitsystemConfig().appId +
"\n" +
WitsystemConfig().token +
"\n" +
timeStamp.toString() +
"\n" +
nonceStr +
"\n" +
body +
"\n";
_options.headers = {
"appId": WitsystemConfig().appId,
"token": WitsystemConfig().token,
"sign": RSAUtil.sign(
RSAUtil.creatdParseKey(WitsystemConfig().rsaPrivateKey), str),
"nonceStr": nonceStr,
"timeStamp": timeStamp,
};
_dio.options = _options;
return await _uploadFile(url, list);
}