feat: 增加删除记录功能
This commit is contained in:
@@ -2,12 +2,13 @@ import type { IProfile } from "@/type/profile";
|
||||
|
||||
const PROFILE_KEY = 'user_profile'
|
||||
|
||||
const OVERVIEW_KEY = 'user_overview'
|
||||
|
||||
function getEmptyProfile(): IProfile {
|
||||
return {
|
||||
gender: '',
|
||||
height: null,
|
||||
name: '',
|
||||
weight: null,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,3 +19,12 @@ export function getProfile(): IProfile {
|
||||
export function saveProfile(data: IProfile) {
|
||||
wx.setStorageSync(PROFILE_KEY, data)
|
||||
}
|
||||
|
||||
export function getOverview(): string[] {
|
||||
return wx.getStorageSync(OVERVIEW_KEY) || []
|
||||
}
|
||||
|
||||
export function saveOverview(data: string[]) {
|
||||
wx.setStorageSync(OVERVIEW_KEY, data)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user