| | |
| | | </view> |
| | | <!-- 信息 --> |
| | | <view class="user-info"> |
| | | <view class="user-name">陈鹏</view> |
| | | <view class="user-name">{{username}}</view> |
| | | <view class="user-company">中扬立库技术有限公司</view> |
| | | </view> |
| | | <!-- 更多 --> |
| | |
| | | export default{ |
| | | data() { |
| | | return { |
| | | |
| | | username: '' |
| | | } |
| | | }, |
| | | onShow() { |
| | | this.getDetail() |
| | | }, |
| | | methods: { |
| | | userDetail() { |
| | | uni.navigateTo({ |
| | | url:'/pages/user/user_detail/userDetail' |
| | | }) |
| | | } |
| | | }, |
| | | getDetail() { |
| | | let that = this |
| | | uni.request({ |
| | | url: that.baseUrl + '/user/detail/auth', |
| | | header: {'token' : uni.getStorageSync('token')}, |
| | | method: 'POST', |
| | | success(res) { |
| | | res = res.data |
| | | if (res.code === 200) { |
| | | that.username = res.data.username |
| | | } else if (res.code === 403) { |
| | | uni.showToast({title: res.msg, icon: "none", position: 'top'}) |
| | | setTimeout(() => { |
| | | uni.reLaunch({ |
| | | url: '../../login/login' |
| | | }); |
| | | }, 1000); |
| | | } else { |
| | | uni.showToast({title: res.msg, icon: "none",position: 'top'}) |
| | | } |
| | | console.log(res.data); |
| | | } |
| | | }) |
| | | }, |
| | | } |
| | | } |
| | | </script> |