1
This commit is contained in:
@@ -13,10 +13,32 @@ const _sfc_main = {
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
const hasToken = (() => {
|
||||
try {
|
||||
return !!common_vendor.index.getStorageSync("TOKEN");
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
})();
|
||||
if (!hasToken) {
|
||||
this.items = [];
|
||||
this.categories = [];
|
||||
common_vendor.index.showToast({ title: "请登录使用该功能", icon: "none" });
|
||||
return;
|
||||
}
|
||||
this.fetchCategories();
|
||||
this.reload();
|
||||
},
|
||||
onShow() {
|
||||
const hasToken = (() => {
|
||||
try {
|
||||
return !!common_vendor.index.getStorageSync("TOKEN");
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
})();
|
||||
if (!hasToken)
|
||||
return;
|
||||
this.reload();
|
||||
},
|
||||
computed: {
|
||||
|
||||
Reference in New Issue
Block a user