From f0e850159cd30d0739c7c7c446a6f91603288dcf Mon Sep 17 00:00:00 2001 From: admin <> Date: Thu, 4 Jul 2024 09:24:29 +0800 Subject: [PATCH] =?UTF-8?q?update:=20sass=E6=8E=A5=E5=8F=A3=E8=81=94?= =?UTF-8?q?=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config/env.ts | 6 ++-- src/pagesLogin/login/index.vue | 52 +++++++++++++++++++++++----------- src/services/profile.ts | 11 +++++++ src/store/modules/member.ts | 33 ++++++++++++--------- src/utils/http.ts | 18 +++++++----- 5 files changed, 81 insertions(+), 39 deletions(-) diff --git a/src/config/env.ts b/src/config/env.ts index 4de3bbe..ac7ed96 100644 --- a/src/config/env.ts +++ b/src/config/env.ts @@ -3,7 +3,8 @@ const development = { // VITE_APP_BASE_URL: 'http://47.100.31.83:8081', // VITE_APP_BASE_URL: 'https://47.100.31.83:8081', // appid: '', - VITE_APP_BASE_URL: 'http://cloud.52zaisheng.cn/test/saas', + // VITE_APP_BASE_URL: 'http://cloud.52zaisheng.cn/test/saas', + VITE_APP_BASE_URL: 'https://ifanda.52zaisheng.cn/prod', appid: 'wx9251d74fe0e87028', } @@ -13,7 +14,8 @@ const test = { } const production = { - VITE_APP_BASE_URL: 'http://cloud.52zaisheng.cn/test/saas', + VITE_APP_BASE_URL: 'https://ifanda.52zaisheng.cn/prod', + // VITE_APP_BASE_URL: 'http://cloud.52zaisheng.cn/test/saas', appid: 'wx9251d74fe0e87028', } diff --git a/src/pagesLogin/login/index.vue b/src/pagesLogin/login/index.vue index 0d69821..6715646 100644 --- a/src/pagesLogin/login/index.vue +++ b/src/pagesLogin/login/index.vue @@ -236,18 +236,40 @@ const submit = () => { }); return; } - ProfileApi.loginByAccount(model1.userInfo).then((res: any) => { - if (res.code === 200) { - if(checkGroup.rememberCheck.length === 1) { - uni.setStorageSync('catchLoginInfo', model1.userInfo); - } else { - uni.setStorageSync('catchLoginInfo', {}); + console.log('获取货场信息') + // 获取货场信息 + ProfileApi.getCommonDbPhone({ phone: model1.userInfo.userName }).then( + (res: any) => { + if (res.code === 200) { + if (res.data.length === 0) { + uni.showToast({ + icon: "none", + title: "当前用户暂未分配货场,请联系管理员", + }); + } else { + store.setCode(res.data[0].mechanismCode); + if (store.code) { + loginByAccount(); + } + } } - store.setProfile(res.data); - uni.reLaunch({ - url: "/pagesHome/index", // 要跳转到的页面路径 - }); } + ); + } + }); +}; + +const loginByAccount = () => { + ProfileApi.loginByAccount(model1.userInfo).then((res: any) => { + if (res.code === 200) { + if (checkGroup.rememberCheck.length === 1) { + uni.setStorageSync("catchLoginInfo", model1.userInfo); + } else { + uni.setStorageSync("catchLoginInfo", {}); + } + store.setProfile(res.data); + uni.reLaunch({ + url: "/pagesHome/index", // 要跳转到的页面路径 }); } }); @@ -319,14 +341,12 @@ const state = reactive({ // }); onShow(() => { - if (uni.getStorageSync('catchLoginInfo')) { - const {userName, password} = uni.getStorageSync('catchLoginInfo') - model1.userInfo.userName = userName - model1.userInfo.password = password + if (uni.getStorageSync("catchLoginInfo")) { + const { userName, password } = uni.getStorageSync("catchLoginInfo"); + model1.userInfo.userName = userName; + model1.userInfo.password = password; } - }); -