Browse Source

处理uni兼容H5登录逻辑

master
gaoxs 5 years ago
parent
commit
f2a20329c7
  1. 2
      components/ShareInfo.vue
  2. 1
      pages/Loading/index.vue
  3. 4
      pages/orderAdmin/OrderCancellation/index.vue
  4. 7
      utils/index.js

2
components/ShareInfo.vue

@ -1,7 +1,7 @@
<template> <template>
<view v-if="shareInfoStatus" class="poster-first"> <view v-if="shareInfoStatus" class="poster-first">
<view class="mask-share"> <view class="mask-share">
<image src="@/static/images/s/share-info.png" @click="shareInfoClose" /> <!-- <image src="@/static/images/share-info.png" @click="shareInfoClose" /> -->
</view> </view>
</view> </view>
</template> </template>

1
pages/Loading/index.vue

@ -26,6 +26,7 @@ export default {
return {}; return {};
}, },
onShow() { onShow() {
var url = handleQrCode(); var url = handleQrCode();
// //
if (url) { if (url) {

4
pages/orderAdmin/OrderCancellation/index.vue

@ -9,9 +9,9 @@
</view> </view>
<view class="bnt" @click="storeCancellation">立即核销</view> <view class="bnt" @click="storeCancellation">立即核销</view>
</view> </view>
<view class="scan" v-if="iswechat"> <!-- <view class="scan" v-if="iswechat">
<image src="@/static/images/scan.gif" @click="openQRCode" /> <image src="@/static/images/scan.gif" @click="openQRCode" />
</view> </view> -->
<WriteOff :iShidden="iShidden" :orderInfo="orderInfo" @cancel="cancel" @confirm="confirm"></WriteOff> <WriteOff :iShidden="iShidden" :orderInfo="orderInfo" @cancel="cancel" @confirm="confirm"></WriteOff>
</view> </view>
</template> </template>

7
utils/index.js

@ -158,6 +158,11 @@ export const login = () => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
console.log('获取环境商') console.log('获取环境商')
getProvider().then(provider => { getProvider().then(provider => {
console.log('当前的环境商')
console.log(provider)
if (!provider) {
reject()
}
// 调用登录接口 // 调用登录接口
console.log('调用登录接口') console.log('调用登录接口')
uni.login({ uni.login({
@ -496,7 +501,7 @@ export function routerPermissions(url, type) {
}) })
} else { } else {
// 如果不是小程序跳转到登录页 // 如果不是小程序跳转到登录页
console.log('当前是app,开始处理app登录方法') console.log('当前无法自动登录,开始处理登录方法')
push({ push({
path: '/pages/user/Login/index', path: '/pages/user/Login/index',
}) })

Loading…
Cancel
Save