From 49fa0d82a40345342966e810b44429aec0480ef3 Mon Sep 17 00:00:00 2001 From: web <candymxq888@outlook.com> Date: 星期二, 01 七月 2025 17:00:18 +0800 Subject: [PATCH] fix:修改.gitgnore文件,移除打包文件 --- pages/login/index.vue | 50 +++++++++++++++++++++++++++++++++++--------------- 1 files changed, 35 insertions(+), 15 deletions(-) diff --git a/pages/login/index.vue b/pages/login/index.vue index 29b5709..a913541 100644 --- a/pages/login/index.vue +++ b/pages/login/index.vue @@ -1,10 +1,16 @@ <script setup> import { wxLoginApi,adminLoginApi } from '../../api/index.js' import { onMounted,ref } from 'vue' + import { BASE_URL } from '../../config/baseUrl.js'; + const baseUrl = ref(BASE_URL) const loginType = ref(1) //用户登录选项,1:微信登录,0:管理员登录(账号密码) function changeLoginType(){ loginType.value = loginType.value == 1 ? 0 : ( loginType.value == 0 ? 1 : '') + // uni.showToast({ + // title:'该功能正在升级中', + // icon:'none' + // }) } //进入页面判断是否存在openid,存在直接跳转首页 onMounted(() =>{ @@ -34,7 +40,8 @@ }else{ uni.showToast({ title:'登录失败', - icon:'none' + icon:'none', + }) } }) @@ -56,26 +63,31 @@ pwdType.value = str == 'pwd' ? 'text' : ( str == 'text' ? 'password' : 'text') } async function adminLogin(){ - uni.redirectTo({ - url:'/pages/adminPlatform/home' - }) - // await adminLoginApi(form.value).then((res) =>{ - // console.log('管理员登录响应',res) - // if(res.code == 200){ - // uni.redirectTo({ + // uni.redirectTo({ // url:'/pages/adminPlatform/home' // }) - // } - // }) + + await adminLoginApi(form.value).then((res) =>{ + console.log('管理员登录响应',res) + if(res.code == 200){ + uni.setStorageSync('maintainId',JSON.stringify(res.data.id)) + uni.setStorageSync('token',res.data.token) + console.log() + uni.redirectTo({ + url:'/pagesAdmin/adminPlatform/home' + }) + } + }) } </script> <template> <view class="container"> <view class="content"> - <view class="top" style="background-image:url('../../static/images/login/top_bg.png')"> + <view class="top"> + <image class="top-bg" :src="baseUrl + '/upload' + '/qingYuan/images/20241126/2f56a2a7ecfd2544dec5978d2687383e.png'" mode="widthFix"></image> <view class="top--title"> <image class="logo" src="../../static/images/login/logo.png "></image> - <view class="text">清源直饮水运维平台</view> + <view class="text">慧物通直饮水</view> </view> </view> <view class="login-text"> @@ -133,13 +145,21 @@ justify-content: center; align-items: center; height:450rpx; - background-size:100% auto; - background-repeat: no-repeat; - background-position:top; + position: relative; + z-index:1; + // background-size:100% auto; + // background-repeat: no-repeat; + // background-position:top; + .top-bg{ + width:100%; + position: absolute; + top:0; + } .top--title{ display: flex; justify-content: center; align-items: center; + z-index:2; .logo{ width:80rpx; height:80rpx; -- Gitblit v1.9.3