提交 842eef6a 编写于 作者: X xiaoyucoding

feat: mp-alipay storage api

上级 27b2f4ee
...@@ -58,6 +58,8 @@ ...@@ -58,6 +58,8 @@
"uni": true, "uni": true,
"Vue": true, "Vue": true,
"wx": true, "wx": true,
"my": true,
"swan": true,
"__uniConfig": true, "__uniConfig": true,
"__uniRoutes": true, "__uniRoutes": true,
"UniViewJSBridge": true, "UniViewJSBridge": true,
......
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
})
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册