main
parent
2ac5348326
commit
215c3c66ae
2
App.vue
2
App.vue
|
@ -22,7 +22,7 @@
|
||||||
},
|
},
|
||||||
checkLogin() {
|
checkLogin() {
|
||||||
if (!getToken()) {
|
if (!getToken()) {
|
||||||
this.$tab.reLaunch('/pages/login')
|
this.$tab.reLaunch('pages/loginInfo/login')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,8 +4,10 @@
|
||||||
<view class="flex justify-center">
|
<view class="flex justify-center">
|
||||||
<text class="text-[36rpx] text-[#8f8f94]">Hello RuoYi</text>
|
<text class="text-[36rpx] text-[#8f8f94]">Hello RuoYi</text>
|
||||||
<button @click="csqq">数据测试</button>
|
<button @click="csqq">数据测试</button>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
@ -33,6 +35,8 @@ const form = ref({});
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style></style>
|
<style></style>
|
||||||
|
|
|
@ -1,13 +1,19 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<button @click="wxLogin">微信小程序登录</button>
|
<button @click="wxLogin" v-if="type == 'mp-weixin'">微信小程序登录</button>
|
||||||
<button open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">手机号快捷登录</button>
|
<button open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" v-if="type == 'mp-weixin'">手机号快捷登录</button>
|
||||||
<button @click="wxLogins" v-if="type == 'app'">微信登录</button>
|
<button @click="wxLogins" v-if="type == 'app'">微信登录</button>
|
||||||
<div>
|
<div>
|
||||||
<uni-easyinput prefixIcon="search" v-model="phone" placeholder="手机号">
|
<view class="u-demo-block__content">
|
||||||
</uni-easyinput>
|
<up-input
|
||||||
<uni-easyinput prefixIcon="search" v-model="phoneCode" placeholder="验证码">
|
placeholder="请输入手机号"
|
||||||
</uni-easyinput>
|
v-model="phone"
|
||||||
|
border="surround"
|
||||||
|
type="number"
|
||||||
|
clearable
|
||||||
|
></up-input>
|
||||||
|
</view>
|
||||||
|
<up-code-input v-model="phoneCode" mode="line"></up-code-input>
|
||||||
<button @click="phoneLoginCode" v-if="!isCounting">发送验证码</button>
|
<button @click="phoneLoginCode" v-if="!isCounting">发送验证码</button>
|
||||||
<button disabled v-else>{{ countDown }}秒后重新发送</button>
|
<button disabled v-else>{{ countDown }}秒后重新发送</button>
|
||||||
<button @click="PhoneCodeLoginInfo">手机验证码登录</button>
|
<button @click="PhoneCodeLoginInfo">手机验证码登录</button>
|
||||||
|
@ -22,12 +28,10 @@ import { useRouter } from 'vue-router'
|
||||||
import { ref, getCurrentInstance } from 'vue';
|
import { ref, getCurrentInstance } from 'vue';
|
||||||
import { getPhoneCode, PhoneCodeLogin } from "@/api/system/logins";
|
import { getPhoneCode, PhoneCodeLogin } from "@/api/system/logins";
|
||||||
const { proxy } = getCurrentInstance();
|
const { proxy } = getCurrentInstance();
|
||||||
const phone = ref('')
|
const phone = ref()
|
||||||
const phoneCode = ref('')
|
const phoneCode = ref('')
|
||||||
const type = ref("");
|
const type = ref("");
|
||||||
function getPlat() {
|
|
||||||
type.value = uni.getSystemInfoSync().uniPlatform
|
|
||||||
}
|
|
||||||
const wxXCode = ref('')
|
const wxXCode = ref('')
|
||||||
const wxLogin = async () => {
|
const wxLogin = async () => {
|
||||||
uni.login({
|
uni.login({
|
||||||
|
@ -77,8 +81,8 @@ const phoneLogin = () => {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getPlat();
|
|
||||||
//wxLogin();
|
|
||||||
const countDown = ref(60);
|
const countDown = ref(60);
|
||||||
const isCounting = ref(false);
|
const isCounting = ref(false);
|
||||||
const phoneLoginCode = async () => {
|
const phoneLoginCode = async () => {
|
||||||
|
@ -140,7 +144,18 @@ function validatePhoneNumber(phoneNumber) {
|
||||||
return regex.test(phoneNumber);
|
return regex.test(phoneNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getPlat() {
|
||||||
|
type.value = uni.getSystemInfoSync().uniPlatform
|
||||||
|
console.log("当前环境是:",type.value);
|
||||||
|
if(type.value == "mp-weixin"){
|
||||||
|
wxLogin();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
getPlat();
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss"></style>
|
<style lang="scss">
|
||||||
|
.wrap {
|
||||||
|
padding: 24rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
handleLogout() {
|
handleLogout() {
|
||||||
this.$modal.confirm('确定注销并退出系统吗?').then(() => {
|
this.$modal.confirm('确定注销并退出系统吗?').then(() => {
|
||||||
this.$store.dispatch('LogOut').then(() => {
|
this.$store.dispatch('LogOut').then(() => {
|
||||||
this.$tab.reLaunch('/pages/loginInfo/login')
|
this.$tab.reLaunch('/')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue