|
@@ -40,31 +40,17 @@ Page({
|
|
|
},
|
|
|
// 监听用户是否登录
|
|
|
watchLogin: function () {
|
|
|
+ const that = this;
|
|
|
wx.getStorage({
|
|
|
key: 'token',
|
|
|
- success: res => {
|
|
|
- var that = this;
|
|
|
- wx.request({
|
|
|
- url: `${app.globalData.publicUrl}/courtAdmin/api/matchteam`, //接口地址
|
|
|
- method: 'get',
|
|
|
- data: {},
|
|
|
- success(res) {
|
|
|
- if (res.data.errcode == 0) {
|
|
|
- that.setData({
|
|
|
- ranking: res.data.data,
|
|
|
- });
|
|
|
- } else {
|
|
|
- wx.showToast({
|
|
|
- title: res.data.errmsg,
|
|
|
- icon: 'none',
|
|
|
- duration: 2000
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
+ success: async res => {
|
|
|
+ let arr;
|
|
|
+ // 参赛团队
|
|
|
+ arr = await app.$get(`/courtAdmin/api/matchteam`);
|
|
|
+ if (arr.errcode == '0') that.setData({ ranking: arr.data });
|
|
|
},
|
|
|
fail: res => {
|
|
|
- return wx.redirectTo({ url: '/pages/login/index', })
|
|
|
+ wx.redirectTo({ url: '/pages/index/index', })
|
|
|
}
|
|
|
})
|
|
|
},
|