app.ts 680 B

12345678910111213141516171819202122232425
  1. import { login } from "./lib/logic";
  2. import { appUpdate } from "./lib/wx/update";
  3. import { useRouteQuery } from "./utils/route-query";
  4. import i18n from "./i18n/install";
  5. // app.ts
  6. App<IAppOption>({
  7. globalData: {
  8. doctorId: "",
  9. patientId: "",
  10. dictionaries: [],
  11. },
  12. i18n: null,
  13. onLaunch(options: WechatMiniprogram.App.LaunchShowOption) {
  14. i18n().then((value) => this.i18n = value);
  15. appUpdate(true);
  16. const scene = options.query.scene;
  17. const query = useRouteQuery(scene);
  18. wx.setStorageSync("scene", scene);
  19. const doctorId = query.ys;
  20. this.globalData.doctorId = doctorId;
  21. wx.setStorageSync("doctorId", doctorId);
  22. login();
  23. },
  24. });