layabox / LayaAir

LayaAir is a fully platform rendering engine with rich 2D/3D rendering capabilities and a mature integrated development platform

Home Page:https://www.layaair.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

淘宝适配代码 LocalStorage 问题

Binbiubiubiu opened this issue · comments

my.setStorageSync 淘宝官方是 key-data
https://miniapp.open.taobao.com/docV3.htm?docId=956&docType=20&source=search
希望修改下setItem ,还有getItem返回的是{data:"xxx"} 格式的数据 ,希望也能做下兼容

class MiniLocalStorage {
	    constructor() {
	    }
	    static __init__() {
	        MiniLocalStorage.items = MiniLocalStorage;
	    }
	    static setItem(key, value) {
	        TBMiniAdapter.window.my.setStorageSync({ key: key, value: value });
	    }
	    static getItem(key) {
	        return TBMiniAdapter.window.my.getStorageSync({ "key": key });
	    }