Rumah > Soal Jawab > teks badan
我用七牛提供的jar包,引进去始终提示这样的错误。都无语了
有大神指导 指导吗?
怪我咯2017-04-17 18:00:31
public static String getWebUptoken() {
Config.ACCESS_KEY = PropertiesUtil.getString("qiniu.access.key");
Config.SECRET_KEY = PropertiesUtil.getString("qiniu.secret.key");
Mac mac = new Mac(Config.ACCESS_KEY, Config.SECRET_KEY);
// 请确保该bucket已经存在
String bucketName = PropertiesUtil.getString("qiniu.bucket");
PutPolicy putPolicy = new PutPolicy(bucketName);
Calendar cal = Calendar.getInstance();
cal.add(Calendar.HOUR_OF_DAY, 1);
putPolicy.deadline = cal.getTimeInMillis() / 1000;
String uptoken = null;
try {
uptoken = putPolicy.token(mac);
} catch (AuthException e) {
e.printStackTrace();
} catch (JSONException e) {
e.printStackTrace();
}
return uptoken;
PHPz2017-04-17 18:00:31
Saya juga mengalami masalah yang sama. Bolehkah anda beritahu saya bagaimana anda menyelesaikannya?