app.js 485 B

12345678910111213141516171819202122
  1. //app.js
  2. import * as httpUtil from "./utils/httpUtil";
  3. App({
  4. onLaunch: async function () {
  5. // 展示本地存储能力
  6. var logs = wx.getStorageSync("logs") || [];
  7. logs.unshift(Date.now());
  8. wx.setStorageSync("logs", logs);
  9. },
  10. globalData: {
  11. userInfo: null,
  12. },
  13. ...httpUtil,
  14. getData: (event) => {
  15. const { target } = event;
  16. if (!target) return;
  17. const { dataset } = target;
  18. if (!dataset) return;
  19. return dataset;
  20. },
  21. tenant: "test",
  22. });