登录 修改
This commit is contained in:
@@ -3,10 +3,10 @@ const debug = process.env.NODE_ENV == 'development' ? true : false;
|
|||||||
const proxyApi = "/api"
|
const proxyApi = "/api"
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef MP-WEIXIN || APP
|
// #ifdef MP-WEIXIN || APP
|
||||||
// const proxyApi = 'http://192.168.2.96:9889/cashierService' // 王伟
|
const proxyApi = 'http://192.168.2.42:9889/cashierService' // 王伟
|
||||||
// const proxyApi = 'http://192.168.2.74:9888/cashierService' // 帆哥
|
// const proxyApi = 'http://192.168.2.74:9888/cashierService' // 帆哥
|
||||||
// const proxyApiwws = 'ws://192.168.2.74:9888/cashierService' // 测试
|
// const proxyApiwws = 'ws://192.168.2.74:9888/cashierService' // 测试
|
||||||
const proxyApi = 'https://wxcashiertest.sxczgkj.cn/cashierService' // 测试
|
// const proxyApi = 'https://wxcashiertest.sxczgkj.cn/cashierService' // 测试
|
||||||
const proxyApiwws = 'wss://wxcashiertest.sxczgkj.cn/cashierService' // 测试
|
const proxyApiwws = 'wss://wxcashiertest.sxczgkj.cn/cashierService' // 测试
|
||||||
|
|
||||||
// #endif
|
// #endif
|
||||||
@@ -19,7 +19,6 @@ const baseUrlwws = 'ws://cashier.sxczgkj.cn/cashierService'
|
|||||||
// const baseUrl = debug ? proxyApi : 'https://cashier.sxczgkj.cn/cashierService'// 线上
|
// const baseUrl = debug ? proxyApi : 'https://cashier.sxczgkj.cn/cashierService'// 线上
|
||||||
// const baseUrlwws = debug ? proxyApiwws : 'wss://cashier.sxczgkj.cn/cashierService' // 线上
|
// const baseUrlwws = debug ? proxyApiwws : 'wss://cashier.sxczgkj.cn/cashierService' // 线上
|
||||||
const baseUrl = 'https://wxcashiertest.sxczgkj.cn/cashierService'// 测试
|
const baseUrl = 'https://wxcashiertest.sxczgkj.cn/cashierService'// 测试
|
||||||
// const baseUrl = 'http://192.168.2.96:9889/cashierService'
|
|
||||||
const baseUrlwws ='wss://wxcashiertest.sxczgkj.cn/cashierService' // 测试
|
const baseUrlwws ='wss://wxcashiertest.sxczgkj.cn/cashierService' // 测试
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
<input type="mobile" v-model="form.code" placeholder="请输入短信验证码" maxlength="6" />
|
<input type="mobile" v-model="form.code" placeholder="请输入短信验证码" maxlength="6" />
|
||||||
<view class="repeats">
|
<view class="repeats">
|
||||||
<view v-if="showText == true" class="yzm"
|
<view v-if="showText == true" class="yzm"
|
||||||
style="padding: 8rpx 16rpx 6rpx 16rpx; background: #288efb; border-radius: 15rpx"
|
style="padding: 8rpx 16rpx 6rpx 16rpx; background: #F1CB66; border-radius: 15rpx"
|
||||||
@click="CodeRegister">
|
@click="CodeRegister">
|
||||||
{{ Recapture }}
|
{{ Recapture }}
|
||||||
</view>
|
</view>
|
||||||
@@ -39,13 +39,13 @@
|
|||||||
<text @click="passwords">忘记密码?</text>
|
<text @click="passwords">忘记密码?</text>
|
||||||
</view> -->
|
</view> -->
|
||||||
<!-- #ifdef MP-WEIXIN -->
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
<button class="toLogin" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" v-if="!showbox">手机号快速登录
|
<button class="toLogin" open-type="getPhoneNumber" @getphonenumber="userlogin" v-if="!showbox">手机号快速登录
|
||||||
</button>
|
</button>
|
||||||
<view class="toLogin" v-if="showbox" @click="toLoginconfirm">登录</view>
|
<view class="toLogin" v-if="showbox" @click="toLoginconfirm">登录</view>
|
||||||
<view class="toLogins" @click="showbox = !showbox">其他手机号登录/注册</view>
|
<view class="toLogins" @click="showbox = !showbox">其他手机号登录/注册</view>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<!-- #ifdef APP-PLUS || H5 -->
|
<!-- #ifdef APP-PLUS || H5 -->
|
||||||
<button class="toLogin" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" v-if="!showbox">手机号快速登录
|
<button class="toLogin" open-type="getPhoneNumber" @getphonenumber="userlogin" v-if="!showbox">手机号快速登录
|
||||||
</button>
|
</button>
|
||||||
<view class="toLogin" v-if="showbox" @click="toLoginconfirm">登录</view>
|
<view class="toLogin" v-if="showbox" @click="toLoginconfirm">登录</view>
|
||||||
<view class="toLogins" @click="showbox = !showbox">其他手机号登录/注册</view>
|
<view class="toLogins" @click="showbox = !showbox">其他手机号登录/注册</view>
|
||||||
@@ -297,28 +297,29 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
async getPhoneNumber(res) { // 获取手机号
|
// async getPhoneNumber(res) { // 获取手机号
|
||||||
var resdataa = res
|
// var resdataa = res
|
||||||
console.log(res)
|
// console.log(res)
|
||||||
// #ifdef MP-WEIXIN
|
// // #ifdef MP-WEIXIN
|
||||||
uni.login({
|
// uni.login({
|
||||||
provider: 'weixin',
|
// provider: 'weixin',
|
||||||
success: async (data) => {
|
// success: async (data) => {
|
||||||
let resdata = await this.api.logingetPhoneNumber({
|
// let resdata = await this.api.logingetPhoneNumber({
|
||||||
code: data.code,
|
// code: data.code,
|
||||||
iv: resdataa.detail.iv,
|
// iv: resdataa.detail.iv,
|
||||||
encryptedData: resdataa.detail.encryptedData
|
// encryptedData: resdataa.detail.encryptedData
|
||||||
})
|
// })
|
||||||
console.log(resdata)
|
// console.log(resdata)
|
||||||
if (resdata.data) {
|
// if (resdata.data) {
|
||||||
this.phone = resdata.data
|
// this.phone = resdata.data
|
||||||
this.userlogin()
|
// this.userlogin()
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
// #endif
|
// // #endif
|
||||||
},
|
// },
|
||||||
async userlogin() {
|
async userlogin(reslange) {
|
||||||
|
var resdataa = reslange
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
uni.login({
|
uni.login({
|
||||||
provider: 'weixin',
|
provider: 'weixin',
|
||||||
@@ -330,12 +331,10 @@
|
|||||||
uni.cache.set('weixincode', data.code);
|
uni.cache.set('weixincode', data.code);
|
||||||
let res = await this.api.userwxlogin({
|
let res = await this.api.userwxlogin({
|
||||||
code: uni.cache.get('weixincode'), //临时登录凭证
|
code: uni.cache.get('weixincode'), //临时登录凭证
|
||||||
encryptedData: infoRes
|
|
||||||
.encryptedData, // 用户非敏感信息
|
|
||||||
rawData: infoRes.rawData,
|
rawData: infoRes.rawData,
|
||||||
signature: infoRes.signature,
|
signature: infoRes.signature,
|
||||||
iv: infoRes.iv,
|
iv: resdataa.detail.iv,
|
||||||
phone: this.phone
|
encryptedData: resdataa.detail.encryptedData
|
||||||
})
|
})
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
uni.cache.set('token', res.data.token);
|
uni.cache.set('token', res.data.token);
|
||||||
|
|||||||
@@ -86,9 +86,9 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- <view class="card" style="padding-bottom: 20rpx;">
|
<view class="card" style="padding-bottom: 20rpx;" v-if="listinfo.shopQrcode">
|
||||||
<image :src="srcimge" show-menu-by-longpress="true" style="width: 100%;" mode="widthFix"></image>
|
<image :src="listinfo.shopQrcode" show-menu-by-longpress="true" style="width: 100%;" mode="widthFix"></image>
|
||||||
</view> -->
|
</view>
|
||||||
|
|
||||||
<view :style="{height:height}">
|
<view :style="{height:height}">
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user