xmlrpc/pages/logs/logs.js

34 lines
652 B
JavaScript
Raw Normal View History

2025-02-12 09:48:50 +08:00
// logs.js
const util = require('../../utils/util.js')
Page({
data: {
logs: [],
conf: []
2025-02-12 09:48:50 +08:00
},
onLoad() {
this.setData({
logs: (wx.getStorageSync('logs') || []).map(log => {
return {
date: util.formatTime(new Date(log)),
timeStamp: log
}
}),
conf: wx.getStorageSync('conf') || {}
2025-02-12 09:48:50 +08:00
})
},
clearStorageSync() {
wx.clearStorageSync();
wx.showToast({
title: '缓存已清除',
icon: 'success',
duration: 2000
});
// 清除缓存后,可以重新加载数据或重置页面状态
this.setData({
logs: [],
conf: {}
});
2025-02-12 09:48:50 +08:00
}
})