bug fix and performance improvements
This commit is contained in:
@ -1,4 +1,8 @@
|
||||
// index.ts
|
||||
|
||||
import { productList } from "../../api/product"
|
||||
|
||||
|
||||
// 获取应用实例
|
||||
const app = getApp<IAppOption>()
|
||||
|
||||
@ -45,5 +49,28 @@ Page({
|
||||
userInfo: e.detail.userInfo,
|
||||
hasUserInfo: true
|
||||
})
|
||||
},
|
||||
testRequest() {
|
||||
productList({
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
}).then(resp => {
|
||||
console.log(resp);
|
||||
})
|
||||
},
|
||||
onShow() {
|
||||
const app = getApp()
|
||||
console.log(app.globalData.authToken);
|
||||
|
||||
if (!app.globalData.authToken) {
|
||||
console.log(app.globalData.authToken);
|
||||
|
||||
wx.redirectTo({
|
||||
url: "../login/login",
|
||||
fail: (err) => {
|
||||
console.log(err);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@ -16,6 +16,7 @@
|
||||
<image bindtap="bindViewTap" class="userinfo-avatar" src="{{userInfo.avatarUrl}}" mode="cover"></image>
|
||||
<text class="userinfo-nickname">{{userInfo.nickName}}</text>
|
||||
</block>
|
||||
<t-button bind:tap="testRequest">test</t-button>
|
||||
</view>
|
||||
<view class="usermotto">
|
||||
<text class="user-motto">{{motto}}</text>
|
||||
|
||||
Reference in New Issue
Block a user