广场页面跳转接口回显优化

This commit is contained in:
linfeng 2024-04-10 15:59:15 +08:00
parent d24b924104
commit cce48e5297
4 changed files with 27 additions and 2 deletions

View File

@ -177,7 +177,7 @@ public class AppUserInfoController {
}
@Login
@PostMapping("/userRank")
@ApiOperation("发帖达人列表")
public R userRank() {

View File

@ -40,6 +40,7 @@
if (res.code == 0) {
uni.setStorageSync("hasLogin", true);
uni.setStorageSync("token", res.token);
uni.setStorageSync("linfeng", "lf");
uni.switchTab({
url: '/pages/index/index'
});

View File

@ -49,6 +49,7 @@
if (res.code === 0) {
uni.setStorageSync("hasLogin", true);
uni.setStorageSync("token", res.token);
uni.setStorageSync("linfeng", "lf");
that.getUserInfo();
uni.switchTab({
url: '/pages/index/index'

View File

@ -81,7 +81,16 @@
this.getBannerList();
this.getClassList();
this.getUserRanking();
if (uni.getStorageSync("hasLogin")) {
this.getPostList();
} else {
this.goLogin()
}
},
onShow() {
if (uni.getStorageSync("linfeng")) {
this.getPostList();
}
},
onReachBottom() {
if (this.pageCurrent == 0) {
@ -121,6 +130,19 @@
url: '/pages/post/add'
})
},
goLogin() {
// #ifdef MP-WEIXIN
uni.navigateTo({
url: "/pages/login/weixin"
})
// #endif
// #ifdef H5
uni.navigateTo({
url: "/pages/login/login"
})
// #endif
},
pageTabChange(index) {
this.pageCurrent = index
},
@ -145,6 +167,7 @@
},
//
getPostList() {
uni.removeStorageSync("linfeng");
this.loadPostStatus = 'loading';
this.$H
.post('post/list', {