From 45c1cf93e3c7db53f00f8f594751f0b8df2b600f Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Mon, 29 Nov 2021 18:27:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=89=E5=9D=8F=E5=90=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/owner/ownerApi.js | 7 ++----- api/webView/webViewApi.js | 25 ++++++------------------- 2 files changed, 8 insertions(+), 24 deletions(-) diff --git a/api/owner/ownerApi.js b/api/owner/ownerApi.js index 5ad3129..9c87780 100755 --- a/api/owner/ownerApi.js +++ b/api/owner/ownerApi.js @@ -206,12 +206,11 @@ export function hasOwner(){ let loginFlag = wx.getStorageSync(mapping.LOGIN_FLAG); let nowDate = new Date(); //判断如果是APP - if (!loginFlag || loginFlag.expireTime < nowDate.getTime()) { return ; } let _ownerInfo = wx.getStorageSync(mapping.OWNER_INFO); - if(_ownerInfo){ + if(!_ownerInfo){ uni.showToast({ icon:'none', title:'未查询到业主房产' @@ -220,7 +219,6 @@ export function hasOwner(){ } let _memberId = _ownerInfo.memberId; - if(!_memberId){ uni.showToast({ icon:'none', @@ -228,8 +226,7 @@ export function hasOwner(){ }) throw new Error('业主不存在'); } - - if(_memberId != '-1'){ + if(_memberId == '-1'){ uni.showToast({ icon:'none', title:'未查询到业主房产' diff --git a/api/webView/webViewApi.js b/api/webView/webViewApi.js index a12b04b..e007f6e 100644 --- a/api/webView/webViewApi.js +++ b/api/webView/webViewApi.js @@ -36,6 +36,8 @@ import {getStorageSync,setStorageSync} from '../../utils/StorageUtil.js' import {uuid} from '../../utils/SeqUtil.js' +import {getWAppId} from '../init/initApi.js' + const ACTION_NAVIGATE_TO = "navigateTo"; // 跳转 const ACTION_REFRESH_TOKEN = "refreshToken"; const ACTION_NAVIGATE_TO_PAGE = "navigateToPage"; @@ -75,23 +77,6 @@ export function getHcCode(_objData) { }); }) } -/** - * 检查回话 - */ -export function actionRefreshToken(that) { - checkSession().then(function() { - //这部分是 业主端回话有效的情况 - console.log('业主端回话有效'); - uni.navigateTo({ - url: '/pages/hcWebViewRefresh/hcWebViewRefresh?java110Id='+uuid() - }); - }, function(error) { //回话过期 - console.log('回话已经过期'); - let _hasOwnerUrl = window.location.origin+'/#/pages/hcWebViewRefresh/hcWebViewRefresh?java110Id='+uuid(); - let _mallAuthUrl = conf.mallUrl+"/app/userAuth/mallUserRefreshToken?redirectUrl="+encodeURIComponent(_hasOwnerUrl)+"&errorUrl="+conf.mallUrl; - wechatRefreshToken(_mallAuthUrl, '0', _hasOwnerUrl); - }); -} export function getCurrentPage() { let routes = getCurrentPages(); // 获取当前打开过的页面路由数组 @@ -205,8 +190,10 @@ export function reciveMessage(event, that) { }); return; } else if (_data.action == ACTION_REFRESH_TOKEN) { - //校验是否登录,如果没有登录跳转至温馨提示页面 - actionRefreshToken(that); + //跳转登录 + uni.navigateTo({ + url:'/pages/showlogin/showlogin?wAppId='+getWAppId() + }) } else if (_data.action == ACTION_NAVIGATE_TO_PAGE) { //_data.url = encodeUrl(_data.url); window.location.href = _data.url;