mirror of
https://gitee.com/java110/WechatOwnerService.git
synced 2026-02-23 21:36:38 +08:00
优化监控功能
This commit is contained in:
parent
f05adbec2d
commit
f449c7c7f2
@ -71,11 +71,14 @@ export function autoLogin(options) {
|
||||
*/
|
||||
export function autoLoginWechat(options) {
|
||||
let _openId = options.openId;
|
||||
|
||||
if (_openId) { //h5 自登陆的情况
|
||||
let _time = uni.getStorageSync('refreshUserOpenId');
|
||||
if(_time){
|
||||
loginByOpenId(_openId);
|
||||
uni.removeStorageSync('refreshUserOpenId');
|
||||
return;
|
||||
}
|
||||
}
|
||||
//todo 如果参数中带了wAppId
|
||||
let _wAppId = options.wAppId;
|
||||
|
||||
@ -123,6 +126,8 @@ export function _refreshWechatOpenId(options, appId) {
|
||||
wAppId: appId,
|
||||
}).then(_data => {
|
||||
if (_data.code == 0) {
|
||||
let _date = new Date();
|
||||
uni.setStorageSync("refreshUserOpenId", _data.getTime());
|
||||
window.location.href = _data.data.openUrl;
|
||||
return;
|
||||
}
|
||||
@ -181,6 +186,7 @@ export function loginByOpenId(openId){
|
||||
});
|
||||
uni.removeStorageSync("ownerInfo");
|
||||
saveUserLoginInfo(_json.data.userId, _json.data.token, _json.data.key);
|
||||
|
||||
},
|
||||
fail: function(e) {
|
||||
uni.hideLoading();
|
||||
|
||||
@ -35,6 +35,7 @@
|
||||
import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
|
||||
/** index.js **/
|
||||
import context from '../../lib/java110/Java110Context.js';
|
||||
import { getCommunityId } from '../../api/community/communityApi.js';
|
||||
const constant = context.constant; //获取app实例
|
||||
//获取app实例
|
||||
const app = getApp().globalData;
|
||||
@ -61,7 +62,7 @@
|
||||
onLoad: function(options) {
|
||||
let that = this;
|
||||
context.onLoad(options);
|
||||
that.communityId = context.getUserInfo().communityId;
|
||||
that.communityId = getCommunityId();
|
||||
that._loadNotices();
|
||||
},
|
||||
onShow: function() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user