index.ts 531 B

1234567891011121314151617181920212223
  1. import { GetAppStatus } from '../../../service/base';
  2. /** 判断app状态进行跳转 */
  3. export const useAppStatus = async () => {
  4. const app = getApp();
  5. const { status, content } = await GetAppStatus({
  6. appId: app.globalData.appId,
  7. });
  8. switch (status) {
  9. case 'maintain':
  10. uni.reLaunch({
  11. url: `/pages/st1/business/errorPage/maintain/maintain?content=${content}`,
  12. });
  13. break;
  14. case 'offline':
  15. uni.reLaunch({
  16. url: '/pages/st1/business/errorPage/offline/offline',
  17. });
  18. break;
  19. default:
  20. break;
  21. }
  22. };