From b0825d0862ee0125818310df26d11abd12c2d402 Mon Sep 17 00:00:00 2001 From: zmj <1493694146@qq.com> Date: Fri, 27 Oct 2023 19:26:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 9 +- components/animal/farmersCard.vue | 20 +- components/imgCard.vue | 21 +- components/poultry/farmersCard.vue | 20 +- pages/detail/plant.vue | 30 +- pages/feedIng/vaccineInfo.vue | 1 - pages/index/index.vue | 71 +- store/userInfo.js | 4 +- unpackage/dist/dev/app-plus/app-service.js | 3064 ++++++++++---------- 9 files changed, 1638 insertions(+), 1602 deletions(-) diff --git a/App.vue b/App.vue index 0d16aa3..7ebbbf4 100644 --- a/App.vue +++ b/App.vue @@ -2,10 +2,17 @@ import { userInfoStore } from '@/store/userInfo' + import { + userInfoAPI + } from "@/api/plant.js" export default { onLaunch: function() { const userInfo = userInfoStore() - userInfo.saveUserInfo(307) + userInfoAPI({ + user_id: 307 + }).then(res => { + userInfo.saveUserInfo(res.data) + }) uni.setStorageSync("SY_TOKEN", "dfdf4564557445df4df") }, diff --git a/components/animal/farmersCard.vue b/components/animal/farmersCard.vue index 712b88a..bd4438f 100644 --- a/components/animal/farmersCard.vue +++ b/components/animal/farmersCard.vue @@ -44,21 +44,25 @@ reactive, watch } from "vue"; + // import { + // userInfoAPI + // } from "@/api/plant.js" import { - userInfoAPI - } from "@/api/plant.js" - + userInfoStore + } from '@/store/userInfo' + const userInfoStores = userInfoStore() const userInfo = reactive({}) const objFn = (res, data) => { for (let key in res) { data[key] = res[key] } } - userInfoAPI({ - user_id: 307 - }).then(res => { - objFn(res.data, userInfo) - }) + // userInfoAPI({ + // user_id: 307 + // }).then(res => { + // objFn(res.data, userInfo) + // }) + objFn(userInfoStores.userInfo, userInfo)