compress route
This commit is contained in:
parent
7bb7b26e30
commit
e8b23ff4cb
@ -462,7 +462,9 @@ utils.prototype.encodeRoute = function (route) {
|
|||||||
ans+=lastMove.substring(0,1).toUpperCase();
|
ans+=lastMove.substring(0,1).toUpperCase();
|
||||||
if (cnt>1) ans+=cnt;
|
if (cnt>1) ans+=cnt;
|
||||||
}
|
}
|
||||||
return ans;
|
// return ans;
|
||||||
|
// 压缩
|
||||||
|
return LZString.compressToBase64(ans);
|
||||||
}
|
}
|
||||||
|
|
||||||
////// 解密路线 //////
|
////// 解密路线 //////
|
||||||
@ -470,6 +472,14 @@ utils.prototype.decodeRoute = function (route) {
|
|||||||
|
|
||||||
if (!core.isset(route)) return route;
|
if (!core.isset(route)) return route;
|
||||||
|
|
||||||
|
// 解压缩
|
||||||
|
try {
|
||||||
|
var v = LZString.decompressFromBase64(route);
|
||||||
|
if (core.isset(v) && /^[a-zA-Z0-9:]+$/.test(v)) {
|
||||||
|
route = v;
|
||||||
|
}
|
||||||
|
} catch (e) {}
|
||||||
|
|
||||||
var ans=[], index=0;
|
var ans=[], index=0;
|
||||||
|
|
||||||
var getNumber = function (noparse) {
|
var getNumber = function (noparse) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user