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