commit
27605c4cd1
|
@ -30,8 +30,8 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<block v-if="isUp">
|
<block v-if="isUp">
|
||||||
<mobileLogin :isUp="isUp" @close="maskClose" @wechatPhone="wechatPhone"
|
<mobileLogin :isUp="isUp" @close="maskClose" @wechatPhone="wechatPhone" :social-code="socialCode"
|
||||||
:social-code="socialCode" :social-state="socialState" />
|
:social-state="socialState" />
|
||||||
</block>
|
</block>
|
||||||
<block v-if="isPhoneBox">
|
<block v-if="isPhoneBox">
|
||||||
<routinePhone :logoUrl="logoUrl" :isPhoneBox="isPhoneBox" @close="bindPhoneClose" :authKey="authKey">
|
<routinePhone :logoUrl="logoUrl" :isPhoneBox="isPhoneBox" @close="bindPhoneClose" :authKey="authKey">
|
||||||
|
@ -47,7 +47,9 @@
|
||||||
import mobileLogin from '@/components/login_mobile/index.vue'
|
import mobileLogin from '@/components/login_mobile/index.vue'
|
||||||
import routinePhone from '@/components/login_mobile/routine_phone.vue'
|
import routinePhone from '@/components/login_mobile/routine_phone.vue'
|
||||||
import * as BrokerageAPI from '@/api/trade/brokerage.js'
|
import * as BrokerageAPI from '@/api/trade/brokerage.js'
|
||||||
import { getUserPhone } from '@/api/public';
|
import {
|
||||||
|
getUserPhone
|
||||||
|
} from '@/api/public';
|
||||||
import Routine from '@/libs/routine';
|
import Routine from '@/libs/routine';
|
||||||
import wechat from "@/libs/wechat";
|
import wechat from "@/libs/wechat";
|
||||||
export default {
|
export default {
|
||||||
|
@ -86,7 +88,10 @@
|
||||||
window.scrollTo(0, Math.max(scrollHeight - 1, 0));
|
window.scrollTo(0, Math.max(scrollHeight - 1, 0));
|
||||||
}, 100);
|
}, 100);
|
||||||
});
|
});
|
||||||
const { code, state } = options;
|
const {
|
||||||
|
code,
|
||||||
|
state
|
||||||
|
} = options;
|
||||||
this.options = options
|
this.options = options
|
||||||
// 获取确认授权code
|
// 获取确认授权code
|
||||||
this.code = code || ''
|
this.code = code || ''
|
||||||
|
@ -187,14 +192,14 @@
|
||||||
}
|
}
|
||||||
// 情况二:允许授权手机号码
|
// 情况二:允许授权手机号码
|
||||||
const loginCode = await Routine.getCode()
|
const loginCode = await Routine.getCode()
|
||||||
AuthApi.weixinMiniAppLogin(phoneCode, loginCode,'default').then(res => {
|
AuthApi.weixinMiniAppLogin(phoneCode, loginCode, 'default').then(res => {
|
||||||
const data = res.data;
|
const data = res.data;
|
||||||
// TODO 芋艿:refreshToken 机制
|
// TODO 芋艿:refreshToken 机制
|
||||||
this.$store.commit("LOGIN", {
|
this.$store.commit("LOGIN", {
|
||||||
'token': data.accessToken
|
'token': data.accessToken
|
||||||
});
|
});
|
||||||
// 保存opendId用于支付
|
// 保存opendId用于支付
|
||||||
this.$store.commit("OPENID", data.openId);
|
this.$store.commit("OPENID", data.openid);
|
||||||
// 设置当前userId
|
// 设置当前userId
|
||||||
this.$store.commit("SETUID", data.userId);
|
this.$store.commit("SETUID", data.userId);
|
||||||
this.getUserInfo();
|
this.getUserInfo();
|
||||||
|
|
Loading…
Reference in New Issue