logout.vue 822 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <template>
  2. </template>
  3. <script>
  4. export default {
  5. data() {
  6. return {
  7. ptype: ""
  8. };
  9. },
  10. onLoad(e) {
  11. var _this = this;
  12. if (e.ptype) {
  13. this.ptype = e.ptype;
  14. }
  15. _this.$request.post('login.logout', {
  16. ptype: _this.ptype
  17. }).then(res => {
  18. if (res.errno != 0) {
  19. uni.showToast({
  20. title: res.msg,
  21. icon: 'none'
  22. });
  23. return;
  24. } else {
  25. let url = "/pages/login/userlogin?ptype=" + _this.ptype;
  26. if (_this.ptype == 'member') {
  27. url = "/pages/login/login?ptype=" + _this.ptype;
  28. }
  29. uni.reLaunch({
  30. url: url
  31. });
  32. }
  33. });
  34. },
  35. methods: {},
  36. /**
  37. * 页面相关事件处理函数--监听用户下拉动作
  38. */
  39. onPullDownRefresh: function() {
  40. setTimeout(() => {
  41. uni.stopPullDownRefresh()
  42. }, 200);
  43. },
  44. };
  45. </script>