diff --git a/package.json b/package.json index 47df25bf7fe7c89614076d3819df2dce9a73d6e1..fcac136744cf573363a219bcb223816c39b219d2 100644 --- a/package.json +++ b/package.json @@ -58,6 +58,8 @@ "uni": true, "Vue": true, "wx": true, + "my": true, + "swan": true, "__uniConfig": true, "__uniRoutes": true, "UniViewJSBridge": true, diff --git a/src/platforms/mp-alipay/service/api/index.js b/src/platforms/mp-alipay/service/api/index.js index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..22f92b45839da8333227bf8c2e21f5617b994495 100644 --- a/src/platforms/mp-alipay/service/api/index.js +++ b/src/platforms/mp-alipay/service/api/index.js @@ -0,0 +1,22 @@ +export function setStorageSync (key, data) { + return my.setStorageSync({ + key, + data + }) +} +export function getStorageSync (key) { + const result = my.getStorageSync({ + key + }) + // 不知道会不会出现 success 为 false 情况,暂时这样处理下。 + if (result.success) { + return result.data || '' + } else { + return '' + } +} +export function removeStorageSync (key) { + return my.removeStorageSync({ + key + }) +}