wechat-oauth.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <template>
  2. <view>
  3. <u-toast ref="uToast" />
  4. <view class="w75">
  5. <view
  6. class="f-weight-bold"
  7. style="color: #333; font-size: 42rpx; padding-top: 100rpx"
  8. >授权成功</view
  9. >
  10. <view
  11. class="f-size-32"
  12. style="color: #bbb; margin-top: 20rpx"
  13. >请重新登录</view
  14. >
  15. <button
  16. @tap="logout"
  17. class="main-color-bg text-color-white"
  18. style="border-radius: 80rpx; line-height: 100rpx;margin-top:100rpx"
  19. >
  20. 退出登录
  21. </button>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. export default {
  27. data() {
  28. return {
  29. form: {
  30. oldPassword: '', // 手机号
  31. password: '', // 验证码
  32. passwordConfirm: '' // 密码
  33. },
  34. openId: null
  35. };
  36. },
  37. onLoad(options) {
  38. this.openId = options.openId
  39. uni.setStorageSync('openId', this.openId);
  40. },
  41. methods: {
  42. // 退出登录
  43. logout() {
  44. uni.removeStorageSync('userInfo');
  45. uni.removeStorageSync('accessToken');
  46. uni.redirectTo({
  47. url: '/pages/login/login'
  48. });
  49. }
  50. }
  51. };
  52. </script>
  53. <style scoped lang="less">
  54. .input {
  55. width: 600rpx;
  56. margin: 0 auto;
  57. & > view {
  58. height: 100rpx;
  59. border-bottom: 1rpx solid #e6e6e6;
  60. }
  61. .code {
  62. height: 56rpx;
  63. line-height: 56rpx;
  64. padding: 0rpx 20rpx;
  65. background: #ffffff;
  66. border: 1rpx solid #0082ff;
  67. border-radius: 28rpx;
  68. }
  69. input {
  70. height: 100rpx;
  71. }
  72. }
  73. </style>