Skip to content
This repository has been archived by the owner on Nov 12, 2018. It is now read-only.

刷新免登录 #475

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/inject/preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class Injector {
if (Common.DEBUG_MODE) {
Injector.lock(window, 'console', window.console);
}
Injector.shield(window, 'onbeforeunload');
this.initInjectBundle();
this.initAngularInjection();
this.lastUser = null;
Expand Down Expand Up @@ -93,6 +94,16 @@ class Injector {
set: () => {},
});
}
static shield(target, key) {
Object.defineProperty(target, key, {
set: () => {
},
get: () => {
return function () {
}
}
})
}

checkEmojiContent(value, constants) {
if (!(value.AddMsgList instanceof Array)) return value;
Expand Down
2 changes: 1 addition & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class ElectronicWeChat {
this.wechatWindow.loginState.current = this.wechatWindow.loginState.NULL;
this.wechatWindow.connectWeChat();
} else {
this.wechatWindow.loadURL(Common.WEB_WECHAT);
this.wechatWindow.reload();
}
});

Expand Down
3 changes: 3 additions & 0 deletions src/windows/controllers/wechat.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ class WeChatWindow {
loadURL(url) {
this.wechatWindow.loadURL(url);
}
reload() {
this.wechatWindow.reload();
}

show() {
this.wechatWindow.show();
Expand Down