chore: 首次纳入版本控制(审查前基线,v1.2.0)
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
const { apiBase } = require("./utils/config");
|
||||
|
||||
App({
|
||||
globalData: {
|
||||
apiBase,
|
||||
token: "",
|
||||
child: null,
|
||||
},
|
||||
|
||||
onLaunch() {
|
||||
this.globalData.token = wx.getStorageSync("ql_token") || "";
|
||||
this.globalData.child = wx.getStorageSync("ql_child") || null;
|
||||
},
|
||||
|
||||
setToken(token, guardian) {
|
||||
this.globalData.token = token || "";
|
||||
wx.setStorageSync("ql_token", this.globalData.token);
|
||||
if (guardian) wx.setStorageSync("ql_guardian", guardian);
|
||||
},
|
||||
|
||||
setChild(child) {
|
||||
this.globalData.child = child || null;
|
||||
wx.setStorageSync("ql_child", this.globalData.child);
|
||||
},
|
||||
|
||||
clearAuth() {
|
||||
this.globalData.token = "";
|
||||
this.globalData.child = null;
|
||||
wx.removeStorageSync("ql_token");
|
||||
wx.removeStorageSync("ql_child");
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user