有坏吗

This commit is contained in:
java110 2021-11-29 18:27:24 +08:00
parent f412d880cf
commit 45c1cf93e3
2 changed files with 8 additions and 24 deletions

View File

@ -206,12 +206,11 @@ export function hasOwner(){
let loginFlag = wx.getStorageSync(mapping.LOGIN_FLAG); let loginFlag = wx.getStorageSync(mapping.LOGIN_FLAG);
let nowDate = new Date(); let nowDate = new Date();
//判断如果是APP //判断如果是APP
if (!loginFlag || loginFlag.expireTime < nowDate.getTime()) { if (!loginFlag || loginFlag.expireTime < nowDate.getTime()) {
return ; return ;
} }
let _ownerInfo = wx.getStorageSync(mapping.OWNER_INFO); let _ownerInfo = wx.getStorageSync(mapping.OWNER_INFO);
if(_ownerInfo){ if(!_ownerInfo){
uni.showToast({ uni.showToast({
icon:'none', icon:'none',
title:'未查询到业主房产' title:'未查询到业主房产'
@ -220,7 +219,6 @@ export function hasOwner(){
} }
let _memberId = _ownerInfo.memberId; let _memberId = _ownerInfo.memberId;
if(!_memberId){ if(!_memberId){
uni.showToast({ uni.showToast({
icon:'none', icon:'none',
@ -228,8 +226,7 @@ export function hasOwner(){
}) })
throw new Error('业主不存在'); throw new Error('业主不存在');
} }
if(_memberId == '-1'){
if(_memberId != '-1'){
uni.showToast({ uni.showToast({
icon:'none', icon:'none',
title:'未查询到业主房产' title:'未查询到业主房产'

View File

@ -36,6 +36,8 @@ import {getStorageSync,setStorageSync} from '../../utils/StorageUtil.js'
import {uuid} from '../../utils/SeqUtil.js' import {uuid} from '../../utils/SeqUtil.js'
import {getWAppId} from '../init/initApi.js'
const ACTION_NAVIGATE_TO = "navigateTo"; // 跳转 const ACTION_NAVIGATE_TO = "navigateTo"; // 跳转
const ACTION_REFRESH_TOKEN = "refreshToken"; const ACTION_REFRESH_TOKEN = "refreshToken";
const ACTION_NAVIGATE_TO_PAGE = "navigateToPage"; 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() { export function getCurrentPage() {
let routes = getCurrentPages(); // 获取当前打开过的页面路由数组 let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
@ -205,8 +190,10 @@ export function reciveMessage(event, that) {
}); });
return; return;
} else if (_data.action == ACTION_REFRESH_TOKEN) { } 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) { } else if (_data.action == ACTION_NAVIGATE_TO_PAGE) {
//_data.url = encodeUrl(_data.url); //_data.url = encodeUrl(_data.url);
window.location.href = _data.url; window.location.href = _data.url;