diff --git a/app-side/index.js b/app-side/index.js index 654ac2c..f97ba7c 100644 --- a/app-side/index.js +++ b/app-side/index.js @@ -8,7 +8,7 @@ AppSideService( }, onRequest(req, res){ if(req.method === 'totps'){ - console.log(set) + console.log(req) res(null, settings.settingsStorage.getItem('TOTPs')) } }, diff --git a/app.json b/app.json index 2f24d70..128688a 100644 --- a/app.json +++ b/app.json @@ -13,8 +13,7 @@ "description": "TOTP Authenticator for Amazfit devices" }, "permissions": [ - "data:os.device.info", - "device:os.local_storage" + "data:os.device.info" ], "runtime": { "apiVersion": { diff --git a/page/index.js b/page/index.js index 22fd8b0..9f84e28 100644 --- a/page/index.js +++ b/page/index.js @@ -1,9 +1,7 @@ import { RenderAddButton } from './render/totpRenderer' import { initLoop } from './render/index/renderer' import { BasePage } from '@zeppos/zml/base-page' -import { LocalStorage } from "@zos/storage" -const localStorage = new LocalStorage() const app = getApp() let waitForFetch = true; Page( @@ -11,12 +9,11 @@ Page( onInit() { this.getTOTPData().then((x) => { console.log(x) - localStorage.setItem('TOTPs', x ?? []) app._options.globalData.TOTPS = x ?? [] - this.initPage(); + this.initPage() }) .catch(() => { - app._options.globalData.TOTPS = localStorage.getItem('TOTPs') ?? [] + app._options.globalData.TOTPS = [] this.initPage() }) },