setting.vue 592 B

12345678910111213141516171819202122232425262728293031323334
  1. <template>
  2. <view class="main pt0">
  3. <button class="btn" @click="exit()">退出登陆</button>
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. data() {
  9. return {};
  10. },
  11. methods: {
  12. exit() {
  13. uni.showModal({
  14. title: '提示',
  15. content: '确定退出登陆?',
  16. success: (res) => {
  17. if (res.confirm) {
  18. this.http.request({
  19. url: this.getUser().doctor ? '/logout' : '/app/user/exit',
  20. success: (res) => {
  21. uni.removeStorageSync('user');
  22. uni.navigateBack();
  23. }
  24. });
  25. }
  26. }
  27. });
  28. }
  29. }
  30. };
  31. </script>
  32. <style lang="scss"></style>