登录更新,以及地块搜索更新

This commit is contained in:
jia 2023-12-01 10:54:01 +08:00
parent 64e71a2f25
commit aabd2430d2
8 changed files with 33 additions and 19 deletions

View File

@ -20,12 +20,12 @@
种植品牌: {{info.kind}}
</view> -->
</view>
<!-- <view class="card-li">
<view class="card-li" v-if="info.kind">
<view class="">
种植品种: {{info.kind}}
</view>
</view> -->
</view>
<view class="card-li">
<view class="">
土地面积: {{info.total_area}}

View File

@ -54,6 +54,7 @@
login,
xinregister
} from '@/api/api.js';
import {
useStore
} from 'vuex'
@ -172,7 +173,8 @@
uni.showLoading({
title: '登陆中'
})
store.commit('saveUserInfo', res.data)
store.dispatch('saveUserInfo', res.data)
setTimeout(() => {
uni.hideLoading()
uni.reLaunch({

View File

@ -392,7 +392,7 @@
try {
const valid = await form1.value.validate();
if (valid) {
console.log('表单通过', data.formData);
// console.log('', data.formData);
if (pic.length == 0) {
uni.$u.toast('请上传图片')

View File

@ -11,7 +11,8 @@
<!-- #endif -->
<u-search bgColor="white" :show-action="false" margin='0 30rpx' placeholder="搜索你的土地信息"
v-model="fomData.keyword" shape="round"></u-search>
v-model="fomData.keyword" shape="round" :clearabled='false' @change="inputval"></u-search>
<u-button class="custom-style" @click="search">搜索</u-button>
</view>
@ -147,9 +148,18 @@
})
}
//
const inputval= (e) => {
// console.log(e)
if(e.length==0){
list()
}
}
//
const search = () => {
getlist()
list()
}

View File

@ -416,6 +416,7 @@
getlist()
getlist1()
getlist2()
})

View File

@ -14,9 +14,8 @@ const store = createStore({
}
},
actions: {
saveUserInfo({
commit
}, info) {
saveUserInfo({commit}, info) {
commit('saveUserInfo', info)
}

View File

@ -17,11 +17,7 @@ function baseRequest(url, method, data, {
header = config.HEADER;
if (store.state.userInfo) {
header.TOKEN = store.state.userInfo.token
}else{
uni.redirectTo({
url:'/pages/Login/login'
})
}
}
return new Promise((reslove, reject) => {
@ -46,9 +42,10 @@ function baseRequest(url, method, data, {
if (noVerify)
reslove(res.data);
else if (res.data.code == -1) {
if (onReLogin) {
// store.commit('LOGOUT');
return reject();
}
} else if (res.data.code == 0) {
if (res.data.msg != '用户信息不存在') {

View File

@ -37,10 +37,15 @@ function baseRequest(url, method, data, {
if (noVerify)
reslove(res.data);
else if (res.data.code == -1) {
if (onReLogin) {
// store.commit('LOGOUT');
return reject();
}
// if (onReLogin) {
// // store.commit('LOGOUT');
// return reject();
// }
uni.showToast({
title: res.data.msg,
icon: 'none',
})
} else if (res.data.code == 0) {
if (res.data.msg != '用户信息不存在') {
uni.showToast({