We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
设置全局请求拦截后,根据业务需求,需要清除原数据,将原请求数据加密后请求,但是好像同时把文件上传的请求也清除了,导致上传文件后报错文件路径无效,不能够进行正常的文件上传
BaseOkHttp.parameterInterceptListener = (ParameterInterceptListener<Parameter>) (context, url, parameter) -> { String data = parameter.toParameterString(); parameter.clear(); parameter.add("sign",SignData(data)); parameter.add("data", RC4_jm(data)); return parameter; };
File archive=new File(path); String SignTime = Long.toString(System.currentTimeMillis()); WaitDialog.show((AppCompatActivity) requireActivity(), "请稍候...正在上传中.."); HttpRequest.build(requireActivity(), "api.php?app=10000&act=upload") .addHeaders("Charset", "UTF-8") .addParameter("type", "bak") .addParameter("token", token) .addParameter("cdname", name) .addParameter("archive_md5",getFileMD5s(archive,32)) .addParameter("bz", inputStr) .addParameter("file",archive) .addParameter("t",SignTime) .setJsonResponseListener(new JsonResponseListener() { @Override public void onResponse(JsonMap main, Exception error) { WaitDialog.dismiss(); JsonMap msg = new JsonMap(RC4_jm2(main.getString("msg"))); if (error == null) { if (main.getString("code").equals("200")){ Toasty.success(requireContext(),"存档备份完成",Toasty.LENGTH_SHORT).show(); }else { Toasty.info(requireContext(),msg.toString(),Toasty.LENGTH_SHORT).show(); } } else { Toasty.error(requireContext(),"备份失败:"+error,Toasty.LENGTH_SHORT).show(); } } }) .doPost(); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
设置全局请求拦截后,根据业务需求,需要清除原数据,将原请求数据加密后请求,但是好像同时把文件上传的请求也清除了,导致上传文件后报错文件路径无效,不能够进行正常的文件上传
The text was updated successfully, but these errors were encountered: