| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- <template>
- <view>
- <u-toast ref="uToast" />
- <view class="w75">
- <view
- class="f-weight-bold"
- style="color: #333; font-size: 42rpx; padding-top: 100rpx"
- >授权成功</view
- >
- <view
- class="f-size-32"
- style="color: #bbb; margin-top: 20rpx"
- >请重新登录</view
- >
- <button
- @tap="logout"
- class="main-color-bg text-color-white"
- style="border-radius: 80rpx; line-height: 100rpx;margin-top:100rpx"
- >
- 退出登录
- </button>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- form: {
- oldPassword: '', // 手机号
- password: '', // 验证码
- passwordConfirm: '' // 密码
- },
- openId: null
- };
- },
- onLoad(options) {
- this.openId = options.openId
- // 用户此时仍处于登录状态,立即调用绑定接口,而不是仅存缓存等下次密码登录才绑定
- if (this.openId) {
- uni.setStorageSync('openId', this.openId);
- this.$Http.bindUserAndOpenId(this.openId).then(() => {
- uni.removeStorageSync('openId');
- }).catch(err => {
- console.error('微信绑定失败', err);
- });
- }
- },
- methods: {
- // 退出登录
- logout() {
- uni.removeStorageSync('userInfo');
- uni.removeStorageSync('accessToken');
- uni.redirectTo({
- url: '/pages/login/login'
- });
- }
- }
- };
- </script>
- <style scoped lang="less">
- .input {
- width: 600rpx;
- margin: 0 auto;
- & > view {
- height: 100rpx;
- border-bottom: 1rpx solid #e6e6e6;
- }
- .code {
- height: 56rpx;
- line-height: 56rpx;
- padding: 0rpx 20rpx;
- background: #ffffff;
- border: 1rpx solid #0082ff;
- border-radius: 28rpx;
- }
- input {
- height: 100rpx;
- }
- }
- </style>
|