更新微信公众号登录
parent
8c72cdcb0a
commit
375653eb78
|
@ -1,5 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
|
<div v-if="!wechatLogin">
|
||||||
<u-navbar :is-back="showBack" :border-bottom="false"></u-navbar>
|
<u-navbar :is-back="showBack" :border-bottom="false"></u-navbar>
|
||||||
<div>
|
<div>
|
||||||
<div class="title">{{loginTitleWay[current].title}}</div>
|
<div class="title">{{loginTitleWay[current].title}}</div>
|
||||||
|
@ -42,12 +43,15 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<myVerification v-if="codeFlag" @send="verification" class="verification" ref="verification" business="LOGIN" />
|
<myVerification v-if="codeFlag" @send="verification" class="verification" ref="verification" business="LOGIN" />
|
||||||
|
</div>
|
||||||
|
<view v-else>
|
||||||
|
<wechatH5Login />
|
||||||
|
</view>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { openIdLogin ,loginCallback } from "@/api/connect.js";
|
import { openIdLogin, loginCallback } from "@/api/connect.js";
|
||||||
import api from "@/config/api.js";
|
import api from "@/config/api.js";
|
||||||
import { sendMobile, smsLogin } from "@/api/login";
|
import { sendMobile, smsLogin } from "@/api/login";
|
||||||
import myVerification from "@/components/verification/verification.vue"; //验证码模块
|
import myVerification from "@/components/verification/verification.vue"; //验证码模块
|
||||||
|
@ -56,13 +60,15 @@ import verifyCode from "@/components/verify-code/verify-code";
|
||||||
import { getUserInfo } from "@/api/members";
|
import { getUserInfo } from "@/api/members";
|
||||||
import { whetherNavigate } from "@/utils/Foundation"; //登录跳转
|
import { whetherNavigate } from "@/utils/Foundation"; //登录跳转
|
||||||
import storage from "@/utils/storage.js"; //缓存
|
import storage from "@/utils/storage.js"; //缓存
|
||||||
|
import wechatH5Login from "./wechatH5Login.vue";
|
||||||
|
import { webConnect } from "@/api/connect.js";
|
||||||
export default {
|
export default {
|
||||||
components: { myVerification, verifyCode },
|
components: { myVerification, verifyCode, wechatH5Login },
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
uuid,
|
uuid,
|
||||||
|
wechatLogin: false, //是否加载微信公众号登录
|
||||||
flage: false, //是否验证码验证
|
flage: false, //是否验证码验证
|
||||||
codeFlag: true, //验证开关,用于是否展示验证码
|
codeFlag: true, //验证开关,用于是否展示验证码
|
||||||
tips: "",
|
tips: "",
|
||||||
|
@ -117,7 +123,28 @@ export default {
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
onShow() {
|
||||||
|
//#ifdef H5
|
||||||
|
let isWXBrowser = /micromessenger/i.test(navigator.userAgent);
|
||||||
|
if (isWXBrowser) {
|
||||||
|
webConnect("WECHAT").then((res) => {
|
||||||
|
let data = res.data;
|
||||||
|
if (data.success) {
|
||||||
|
window.location = data.result;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//#endif
|
||||||
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
// #ifndef APP-PLUS
|
||||||
|
//判断是否微信浏览器
|
||||||
|
var ua = window.navigator.userAgent.toLowerCase();
|
||||||
|
if (ua.match(/MicroMessenger/i) == "micromessenger") {
|
||||||
|
this.wechatLogin = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
/**
|
/**
|
||||||
* 条件编译判断当前客户端类型
|
* 条件编译判断当前客户端类型
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue