测试环境下才有这个测试-账号登陆

This commit is contained in:
wangxiaowei
2026-01-07 17:29:23 +08:00
parent c2a651c2d0
commit f6c2e48595

View File

@ -31,7 +31,12 @@
</view>
<view class="mt-124rpx mx-60rpx box-border">
<wd-button custom-class="!bg-[#4C9F44] !rounded-8rpx !text-[#fff] !text-30rpx !leading-42rpx !h-90rpx !w-[100%] box-border" @click="Login.handleLogin">立即登录</wd-button>
<!-- <wd-button custom-class="!bg-[#4C9F44] !rounded-8rpx !text-[#fff] !text-30rpx !leading-42rpx !h-90rpx !w-[100%] box-border" @click="Login.handleMobileLogin">测试-账号登录</wd-button> -->
<wd-button
v-if="env === 'development'"
custom-class="!bg-[#4C9F44] !rounded-8rpx !text-[#fff] !text-30rpx !leading-42rpx !h-90rpx !w-[100%] box-border"
@click="Login.handleMobileLogin">
测试-账号登录
</wd-button>
<!-- <wd-button open-type="getUserInfo" @getuserinfo="Login.handleWxLogin" custom-class="!bg-[#4C9F44] !rounded-8rpx !text-[#fff] !text-30rpx !leading-42rpx !h-90rpx !w-[100%] box-border">立即登录</wd-button> -->
<!-- <view class="text-30rpx font-400 text-[#303133] leading-42rpx text-center mt-32rpx">其它手机号登录</view> -->
</view>
@ -56,6 +61,7 @@
import { getMobileByMnp } from '@/api/user'
const OSS = inject('OSS')
const env = import.meta.env.VITE_NODE_ENV
// 服务协议条款
const agree = ref<boolean>(false)
@ -134,17 +140,17 @@
/**
* 测试-账号登录
*/
// handleMobileLogin: async () => {
// const userStore = useUserStore()
// console.log("🚀 ~ userStore:", userStore)
// const res = await userStore.mobileLogin('15005837859', 1, 2)
// if (res) {
// uni.setStorageSync('latitude', '30.74744')
// uni.setStorageSync('longitude', '120.78483')
// toast.info('登录成功')
// router.navigateBack(1, 500)
// }
// },
handleMobileLogin: async () => {
const userStore = useUserStore()
console.log("🚀 ~ userStore:", userStore)
const res = await userStore.mobileLogin('15005837859', 1, 2)
if (res) {
uni.setStorageSync('latitude', '30.74744')
uni.setStorageSync('longitude', '120.78483')
toast.info('登录成功')
router.navigateBack(1, 500)
}
},
/**
* 登录成功跳转页面