球星卡微信小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
555 B

  1. /**
  2. * @description token失效时跳转登录页方法
  3. * @return { Function }
  4. */
  5. export const httpMessage = (function () {
  6. let isTp = true
  7. // 返回一个闭包来保证同时间段的多次请求错误都只弹出一个窗口
  8. return function (msg) {
  9. if (isTp) {
  10. isTp = false
  11. uni.showModal({
  12. title: '提示',
  13. content: msg,
  14. showCancel: false,
  15. confirmText: '确定',
  16. success: (res) =>{
  17. if (res.confirm) {
  18. isTp = true
  19. uni.reLaunch({
  20. url: '/pages/login/login',
  21. })
  22. }
  23. }
  24. })
  25. }
  26. }
  27. })()