diff --git a/pages/index/index.vue b/pages/index/index.vue index fc6d518..fcb6a8a 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -1268,21 +1268,24 @@ this.getDelivery(); this.getShopArea(); let that = this - that.tui.request("/worker/admin/add", "POST", { - userId: uni.getStorageSync('id'), - isChangeArea: 0, - region: item.id - }, false, true).then((res) => { - if (res.code == 200) { - if (res.result != null) { - uni.setStorageSync('worker', res.result) + if(uni.getStorageSync('hiver_token')){ + that.tui.request("/worker/admin/add", "POST", { + userId: uni.getStorageSync('id'), + isChangeArea: 0, + region: item.id + }, false, true).then((res) => { + if (res.code == 200) { + if (res.result != null) { + uni.setStorageSync('worker', res.result) + } + } else { + that.tui.toast(res.message) + return } - } else { - that.tui.toast(res.message) - return - } - uni.hideLoading() - }).catch((res) => {}) + uni.hideLoading() + }).catch((res) => {}) + } + this.$refs.areaPopup.close() }, checkArea() {