调整部分内容
This commit is contained in:
parent
2e05794a09
commit
f260fdfbc3
@ -11,6 +11,9 @@ const userStore = useUserStore()
|
|||||||
const codeUrl = ref("");
|
const codeUrl = ref("");
|
||||||
const captchaEnabled = ref(true); // 是否开启验证码
|
const captchaEnabled = ref(true); // 是否开启验证码
|
||||||
const useWxLogin = ref(false); // 是否使用微信登录
|
const useWxLogin = ref(false); // 是否使用微信登录
|
||||||
|
// #if MP-WEIXIN
|
||||||
|
useWxLogin.value = true
|
||||||
|
// #endif
|
||||||
const globalConfig = ref(config);
|
const globalConfig = ref(config);
|
||||||
const loginForm = ref({
|
const loginForm = ref({
|
||||||
username: "admin",
|
username: "admin",
|
||||||
@ -19,7 +22,7 @@ const loginForm = ref({
|
|||||||
uuid: ''
|
uuid: ''
|
||||||
});
|
});
|
||||||
|
|
||||||
if (useWxLogin.value) {
|
function handleLoginByWx() {
|
||||||
getWxCode().then(res => {
|
getWxCode().then(res => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
wxLogin('miniapp', res).then(res => {
|
wxLogin('miniapp', res).then(res => {
|
||||||
@ -119,6 +122,8 @@ getCode();
|
|||||||
</view>
|
</view>
|
||||||
<view class="action-btn">
|
<view class="action-btn">
|
||||||
<button @click="handleLogin" class="login-btn cu-btn block bg-blue lg round">登录</button>
|
<button @click="handleLogin" class="login-btn cu-btn block bg-blue lg round">登录</button>
|
||||||
|
<button @click="handleLoginByWx" v-if="useWxLogin"
|
||||||
|
class="login-btn cu-btn block bg-green lg round">微信一键登录</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@ -180,11 +185,19 @@ page {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.login-btn {
|
.action-btn {
|
||||||
margin-top: 40px;
|
margin-top: 40px;
|
||||||
height: 45px;
|
|
||||||
|
.login-btn {
|
||||||
|
height: 45px;
|
||||||
|
|
||||||
|
&+.login-btn {
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.xieyi {
|
.xieyi {
|
||||||
color: #333;
|
color: #333;
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user