feat: 增加可以自定义默认值功能
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import type { IProfile } from "@/type/profile";
|
||||
import type {IDefaultRecordValue, IProfile} from "@/type/profile";
|
||||
|
||||
const PROFILE_KEY = 'user_profile'
|
||||
const OVERVIEW_KEY = 'user_overview'
|
||||
const PLAN_KEY = 'user_plan'
|
||||
const DEFAULT_RECORD_VALUE_KEY = 'user_default_record_value'
|
||||
|
||||
function getEmptyProfile(): IProfile {
|
||||
return {
|
||||
@@ -20,6 +21,14 @@ export function saveProfile(data: IProfile) {
|
||||
wx.setStorageSync(PROFILE_KEY, data)
|
||||
}
|
||||
|
||||
export function getDefaultRecordValue(): IDefaultRecordValue {
|
||||
return wx.getStorageSync(DEFAULT_RECORD_VALUE_KEY)
|
||||
}
|
||||
|
||||
export function saveDefaultRecordValue(data: IDefaultRecordValue) {
|
||||
wx.setStorageSync(DEFAULT_RECORD_VALUE_KEY, data)
|
||||
}
|
||||
|
||||
export function getOverview(): string[] {
|
||||
return wx.getStorageSync(OVERVIEW_KEY) || []
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user