bug fix and performance improvements

This commit is contained in:
quantulr
2023-08-18 17:32:18 +08:00
parent 3c6ab550cf
commit e750b9be9c
923 changed files with 46650 additions and 9 deletions

View File

@ -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);
}
})
}
}
})

View File

@ -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>