mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
fix: wbiSign
This commit is contained in:
@@ -1676,7 +1676,9 @@ class Utils {
|
||||
return base64.encode(randomBytes);
|
||||
}
|
||||
|
||||
static String getFileName(String uri) {
|
||||
return uri.substring(uri.lastIndexOf('/') + 1);
|
||||
static String getFileName(String uri, {bool fileExt = true}) {
|
||||
final i0 = uri.lastIndexOf('/') + 1;
|
||||
final i1 = fileExt ? uri.length : uri.lastIndexOf('.');
|
||||
return uri.substring(i0, i1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,8 +83,9 @@ class WbiSign {
|
||||
if (resp.data['code'] == 0) {
|
||||
final wbiUrls = resp.data['data']['wbi_img'];
|
||||
|
||||
mixinKey = getMixinKey(Utils.getFileName(wbiUrls['img_url']) +
|
||||
Utils.getFileName(wbiUrls['sub_url']));
|
||||
mixinKey = getMixinKey(
|
||||
Utils.getFileName(wbiUrls['img_url'], fileExt: false) +
|
||||
Utils.getFileName(wbiUrls['sub_url'], fileExt: false));
|
||||
|
||||
localCache.put(LocalCacheKey.mixinKey, mixinKey);
|
||||
localCache.put(LocalCacheKey.timeStamp, nowDate.millisecondsSinceEpoch);
|
||||
|
||||
Reference in New Issue
Block a user