完成单组练习接口调试
This commit is contained in:
12
src/store.js
12
src/store.js
@@ -8,7 +8,11 @@ export default defineStore("store", {
|
||||
id: "",
|
||||
nickName: "游客",
|
||||
avatarUrl: "../static/avatar.png",
|
||||
trio: false, // 是否完成新手试炼
|
||||
trio: 0, // 大于1表示完成了新手引导
|
||||
},
|
||||
device: {
|
||||
id: "",
|
||||
deviceName: "",
|
||||
},
|
||||
}),
|
||||
|
||||
@@ -24,6 +28,10 @@ export default defineStore("store", {
|
||||
updateUser(user) {
|
||||
this.user = user;
|
||||
},
|
||||
updateDevice(deviceId, deviceName) {
|
||||
this.device.id = deviceId;
|
||||
this.device.deviceName = deviceName;
|
||||
},
|
||||
},
|
||||
|
||||
// 开启数据持久化
|
||||
@@ -32,7 +40,7 @@ export default defineStore("store", {
|
||||
strategies: [
|
||||
{
|
||||
storage: uni.getStorageSync,
|
||||
paths: ["user"], // 只持久化用户信息
|
||||
paths: ["user", "device"], // 只持久化用户信息
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user