更改重复请求 加了节流
This commit is contained in:
2
App.vue
2
App.vue
@@ -53,10 +53,8 @@
|
||||
},
|
||||
methods: {
|
||||
userlogin() {
|
||||
console.log(333)
|
||||
if (!uni.cache.get('token')) {
|
||||
// this.$store.dispatch("loginEvent"); //获取shapid
|
||||
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: (data) => {
|
||||
|
||||
@@ -113,7 +113,7 @@ async function request(options) {
|
||||
// // }, 1000)
|
||||
// }
|
||||
// })
|
||||
uni.$u.debounce(store.dispatch("loginEvent"), 1000); //获取shapid
|
||||
uni.$u.throttle(store.dispatch("loginEvent"), 1000); //获取shapid
|
||||
|
||||
} else if (res.code == 482) {
|
||||
let nowTime = new Date() / 1000 | 0
|
||||
|
||||
Reference in New Issue
Block a user