From c7719193260cb1e0fc6802dd01764f970760c872 Mon Sep 17 00:00:00 2001 From: lijie_ycrj <1540286404@qq.com> Date: Thu, 6 Nov 2025 19:51:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B8=AE=E6=89=B6=E7=99=BB=E5=BD=95=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packageB/login.vue | 62 ++++++++++++++++++++-------- pages/index/components/index-one.vue | 3 +- 2 files changed, 46 insertions(+), 19 deletions(-) diff --git a/packageB/login.vue b/packageB/login.vue index bd5bce1..447df04 100644 --- a/packageB/login.vue +++ b/packageB/login.vue @@ -40,6 +40,7 @@ const placeholderStyle = 'font-size:30rpx' const checked = ref(true) const codeUrl = ref('') + const flag=ref('hlw') const form = reactive({ username: 'langchaojituan', @@ -49,8 +50,9 @@ uuid: '' }) - onLoad(() => { - + onLoad((option) => { + console.log("option",option) + flag.value=option.flag }) onMounted(() => { @@ -83,27 +85,51 @@ title: '登录中...', mask: true }) - $api.myRequest('/auth/login',form,'post',10100).then((res) => { - console.log(res, 'res') - uni.setStorageSync('Padmin-Token', res.data.access_token) - uni.reLaunch({ - url: '/pages/index/index' + if(flag.value=='hlw'){ + $api.myRequest('/auth/login',form,'post',10100).then((res) => { + uni.setStorageSync('Padmin-Token', res.data.access_token) + uni.reLaunch({ + url: '/pages/index/index' + }) + codeUrl.value = 'data:image/gif;base64,' + res.img + }).catch(() => { + uni.hideLoading() + uni.showToast({ + icon: 'none', + title: '登录失败,请重试' + }) }) - codeUrl.value = 'data:image/gif;base64,' + res.img - }).catch(() => { - uni.hideLoading() - uni.showToast({ - icon: 'none', - title: '登录失败,请重试' + }else if(flag.value=='nw'){ + $api.myRequest('/auth/login',form,'post',9100).then((res) => { + uni.setStorageSync('Padmin-Token', res.data.access_token) + uni.reLaunch({ + url: '/packageB/priority/helpFilter' + }) + codeUrl.value = 'data:image/gif;base64,' + res.img + }).catch(() => { + uni.hideLoading() + uni.showToast({ + icon: 'none', + title: '登录失败,请重试' + }) }) - }) + } + } function getCodeImg() { - $api.myRequest('/code',{},'get',10100).then((resData) => { - codeUrl.value = 'data:image/gif;base64,' + resData.img - form.uuid = resData.uuid - }); + if(flag.value=='hlw'){ + $api.myRequest('/code',{},'get',10100).then((resData) => { + codeUrl.value = 'data:image/gif;base64,' + resData.img + form.uuid = resData.uuid + }); + }else if(flag.value=='nw'){ + $api.myRequest('/code',{},'get',9100).then((resData) => { + codeUrl.value = 'data:image/gif;base64,' + resData.img + form.uuid = resData.uuid + }); + } + } diff --git a/pages/index/components/index-one.vue b/pages/index/components/index-one.vue index bbb7683..1713a8b 100644 --- a/pages/index/components/index-one.vue +++ b/pages/index/components/index-one.vue @@ -749,7 +749,8 @@ const navToTestPage = () => { navTo('/pages/test/homepage-test'); }; const navToPage = () =>{ - navTo('/packageB/priority/helpFilter'); + navTo('/packageB/login?flag=nw'); + // navTo('/packageB/priority/helpFilter'); } async function loadData() {