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);
|
return base64.encode(randomBytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
static String getFileName(String uri) {
|
static String getFileName(String uri, {bool fileExt = true}) {
|
||||||
return uri.substring(uri.lastIndexOf('/') + 1);
|
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) {
|
if (resp.data['code'] == 0) {
|
||||||
final wbiUrls = resp.data['data']['wbi_img'];
|
final wbiUrls = resp.data['data']['wbi_img'];
|
||||||
|
|
||||||
mixinKey = getMixinKey(Utils.getFileName(wbiUrls['img_url']) +
|
mixinKey = getMixinKey(
|
||||||
Utils.getFileName(wbiUrls['sub_url']));
|
Utils.getFileName(wbiUrls['img_url'], fileExt: false) +
|
||||||
|
Utils.getFileName(wbiUrls['sub_url'], fileExt: false));
|
||||||
|
|
||||||
localCache.put(LocalCacheKey.mixinKey, mixinKey);
|
localCache.put(LocalCacheKey.mixinKey, mixinKey);
|
||||||
localCache.put(LocalCacheKey.timeStamp, nowDate.millisecondsSinceEpoch);
|
localCache.put(LocalCacheKey.timeStamp, nowDate.millisecondsSinceEpoch);
|
||||||
|
|||||||
Reference in New Issue
Block a user