v1.0.1 #2
@ -8,7 +8,7 @@ AppSideService(
|
|||||||
},
|
},
|
||||||
onRequest(req, res){
|
onRequest(req, res){
|
||||||
if(req.method === 'totps'){
|
if(req.method === 'totps'){
|
||||||
console.log(set)
|
console.log(req)
|
||||||
res(null, settings.settingsStorage.getItem('TOTPs'))
|
res(null, settings.settingsStorage.getItem('TOTPs'))
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
3
app.json
3
app.json
@ -13,8 +13,7 @@
|
|||||||
"description": "TOTP Authenticator for Amazfit devices"
|
"description": "TOTP Authenticator for Amazfit devices"
|
||||||
},
|
},
|
||||||
"permissions": [
|
"permissions": [
|
||||||
"data:os.device.info",
|
"data:os.device.info"
|
||||||
"device:os.local_storage"
|
|
||||||
],
|
],
|
||||||
"runtime": {
|
"runtime": {
|
||||||
"apiVersion": {
|
"apiVersion": {
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
import { RenderAddButton } from './render/totpRenderer'
|
import { RenderAddButton } from './render/totpRenderer'
|
||||||
import { initLoop } from './render/index/renderer'
|
import { initLoop } from './render/index/renderer'
|
||||||
import { BasePage } from '@zeppos/zml/base-page'
|
import { BasePage } from '@zeppos/zml/base-page'
|
||||||
import { LocalStorage } from "@zos/storage"
|
|
||||||
|
|
||||||
const localStorage = new LocalStorage()
|
|
||||||
const app = getApp()
|
const app = getApp()
|
||||||
let waitForFetch = true;
|
let waitForFetch = true;
|
||||||
Page(
|
Page(
|
||||||
@ -11,12 +9,11 @@ Page(
|
|||||||
onInit() {
|
onInit() {
|
||||||
this.getTOTPData().then((x) => {
|
this.getTOTPData().then((x) => {
|
||||||
console.log(x)
|
console.log(x)
|
||||||
localStorage.setItem('TOTPs', x ?? [])
|
|
||||||
app._options.globalData.TOTPS = x ?? []
|
app._options.globalData.TOTPS = x ?? []
|
||||||
this.initPage();
|
this.initPage()
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
app._options.globalData.TOTPS = localStorage.getItem('TOTPs') ?? []
|
app._options.globalData.TOTPS = []
|
||||||
this.initPage()
|
this.initPage()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user