mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-15 15:41:19 +00:00
本地用户优化
This commit is contained in:
203
src/login.html
203
src/login.html
@@ -5,30 +5,12 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="keywords" content="leanote,leanote.com">
|
||||
<meta name="description" content="leanote, Not Just A Notebook!">
|
||||
<meta name="description" content="leanote, Not Just A Notepad!">
|
||||
<meta name="author" content="leanote">
|
||||
<title class="lang">Leanote login</title>
|
||||
<link href="public/css/bootstrap.css" rel="stylesheet">
|
||||
<link href="public/css/font-awesome-4.2.0/css/font-awesome.css" rel="stylesheet">
|
||||
<link href="public/css/index.css" rel="stylesheet">
|
||||
<style>
|
||||
body #container {
|
||||
margin: 0 auto;
|
||||
border-radius: 0;
|
||||
box-shadow: none;
|
||||
border: none;
|
||||
}
|
||||
|
||||
html, body {
|
||||
overflow: hidden;
|
||||
background-color: rgba(247, 249, 250, 0.99);
|
||||
}
|
||||
#winTool {
|
||||
}
|
||||
.drag {
|
||||
left: 50px;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
// for windows
|
||||
if(process.platform != 'darwin') {
|
||||
@@ -38,67 +20,84 @@ if(process.platform != 'darwin') {
|
||||
</head>
|
||||
<body id="boxBody">
|
||||
<div id="container">
|
||||
<!-- 关闭, 最小化, 最大 -->
|
||||
<div id="winTool" class="win-tool clearfix">
|
||||
<a class="tool-close-blur"></a>
|
||||
</div>
|
||||
<div class="bottom"><a id="localAccount" class="lang">Create Local Account</a>
|
||||
<a id="customServer" class="lang">Custom server</a></div>
|
||||
<section id="box" class="animated fadeInUp">
|
||||
<div class="drag"></div>
|
||||
<div>
|
||||
<h1 id="logo">
|
||||
<a onclick="openExternal('http://leanote.com')" id="loadingLogo" title="leanote">
|
||||
<img src="public/images/logo/leanote_icon_blue.png">
|
||||
</a>
|
||||
</h1>
|
||||
<div class="alert alert-danger" id="loginMsg"></div>
|
||||
<div class="boxForm hide">
|
||||
<form>
|
||||
<div class="formContainer">
|
||||
<div class="form-group form-group-1">
|
||||
<input type="text" required placeholder="Username or Email" class="form-control lang-placeholder" id="username" name="username" value="">
|
||||
</div>
|
||||
<div class="form-group pwd-group">
|
||||
<input type="password" required placeholder="Password" class="form-control lang-placeholder" id="pwd1" name="pwd1">
|
||||
</div>
|
||||
<div class="form-group pwd-group">
|
||||
<input type="password" required placeholder="Retype Rassword" class="form-control lang-placeholder" id="pwd2" name="pwd2">
|
||||
<button id="regBtn" class="btn-embeded"><i class="fa fa-arrow-right"></i></button>
|
||||
</div>
|
||||
|
||||
<!-- 关闭, 最小化, 最大 -->
|
||||
<div id="winTool" class="win-tool clearfix">
|
||||
<a class="tool-close-blur"></a>
|
||||
</div>
|
||||
|
||||
<div class="bottom">
|
||||
<a id="customServer" class="lang customServer">Self-hosted Service</a>
|
||||
<a id="localAccount" class="lang localAccount">Create Local Account</a>
|
||||
|
||||
<a id="loginWithLeanote" class="lang loginWithLeanote">Sign in to Leanote</a>
|
||||
</div>
|
||||
|
||||
<section id="box">
|
||||
<div class="drag"></div>
|
||||
<div>
|
||||
<h1 id="logo">
|
||||
<a onclick="openExternal('http://leanote.com')" id="loadingLogo" title="leanote">
|
||||
<img src="public/images/logo/leanote_icon_blue.png">
|
||||
</a>
|
||||
<span class="lang customServer">Self-hosted Service</span>
|
||||
<span class="lang localAccount">Create Local Account</span>
|
||||
</h1>
|
||||
|
||||
<!-- 信息 -->
|
||||
<div class="alert alert-danger" id="loginMsg"></div>
|
||||
|
||||
<!-- 创建本地用户 -->
|
||||
<div class="boxForm local-form">
|
||||
<form>
|
||||
<div class="formContainer">
|
||||
<div class="form-group form-group-1">
|
||||
<input type="text" required placeholder="Username" class="form-control lang-placeholder" id="username" name="username" value="">
|
||||
</div>
|
||||
<div class="form-group form-group-1">
|
||||
<input type="password" required placeholder="Password" class="form-control lang-placeholder" id="pwd1" name="pwd1">
|
||||
</div>
|
||||
<div class="form-group pwd-group">
|
||||
<input type="password" required placeholder="Confirm password" class="form-control lang-placeholder" id="pwd2" name="pwd2">
|
||||
<button id="regBtn" class="btn-embeded" disabled><i class="fa fa-arrow-right"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="boxForm">
|
||||
<form>
|
||||
<div class="formContainer">
|
||||
<div class="form-group form-group-1 hide" id="hostGroup">
|
||||
<input type="text" placeholder="Host, http://leanote.com" class="form-control lang-placeholder" id="host" name="host">
|
||||
|
||||
<!-- 普通用户 -->
|
||||
<div class="boxForm leanote-form">
|
||||
<form>
|
||||
<div class="formContainer">
|
||||
<div class="form-group form-group-1 host-group" id="hostGroup">
|
||||
<input type="text" placeholder="Host, http://leanote.com" class="form-control lang-placeholder" id="host" name="host">
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-1">
|
||||
<input type="text" placeholder="Username or Email" class="form-control lang-placeholder" id="email" name="email" value="">
|
||||
</div>
|
||||
<div class="form-group pwd-group">
|
||||
<input type="password" placeholder="Password" class="form-control lang-placeholder" id="pwd" name="pwd">
|
||||
<button id="loginBtn" class="btn-embeded" disabled><i class="fa fa-arrow-right"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-1">
|
||||
<input type="text" placeholder="Username or Email" class="form-control lang-placeholder" id="email" name="email" value="">
|
||||
<div class="clearfix btns">
|
||||
<a onclick="openExternal('http://leanote.com/findPassword')" class="pull-right m-t-xs"><small class="lang">Forget password?</small></a>
|
||||
<a onclick="openExternal('http://leanote.com/register')" class="pull-right m-t-xs" style="margin-right: 10px"><small class="lang">Sign up</small></a>
|
||||
</div>
|
||||
<div class="form-group pwd-group">
|
||||
<input type="password" placeholder="Password" class="form-control lang-placeholder" id="pwd" name="pwd">
|
||||
<button id="loginBtn" class="btn-embeded" disabled><i class="fa fa-arrow-right"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="clearfix btns">
|
||||
<a onclick="openExternal('http://leanote.com/findPassword')" class="pull-right m-t-xs"><small class="lang">Forget password?</small></a>
|
||||
<a onclick="openExternal('http://leanote.com/register')" class="pull-right m-t-xs" style="margin-right: 10px"><small class="lang">Sign up</small></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<script src="public/config.js"></script>
|
||||
<script src="public/js/jquery-1.9.0.min.js"></script>
|
||||
<script src="public/js/lang.js"></script>
|
||||
<script src="public/js/bootstrap.js"></script>
|
||||
<script src="public/js/app/service.js"></script>
|
||||
<!-- 很慢 -->
|
||||
<script>
|
||||
function getMsg(key) {
|
||||
return langData[key] || key;
|
||||
@@ -108,6 +107,7 @@ function getMsg(key) {
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
|
||||
$('.tool-close-blur').click(function() {
|
||||
gui.getCurrentWindow().close();
|
||||
});
|
||||
@@ -134,11 +134,15 @@ $(function() {
|
||||
function hideMsg() {
|
||||
$("#loginMsg").hide();
|
||||
}
|
||||
|
||||
var $email = $("#email");
|
||||
var $host = $('#host');
|
||||
|
||||
$("#loginBtn").click(function(e) {
|
||||
e.preventDefault();
|
||||
var email = $("#email").val();
|
||||
var email = $email.val();
|
||||
var pwd = $("#pwd").val();
|
||||
var host = $('#host').val();
|
||||
var host = $host.val();
|
||||
|
||||
if(!email) {
|
||||
showMsg(getMsg("Email is required"), "email");
|
||||
@@ -189,6 +193,8 @@ $(function() {
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
// 创建本地账户
|
||||
$("#regBtn").click(function(e) {
|
||||
e.preventDefault();
|
||||
var username = $("#username").val();
|
||||
@@ -200,11 +206,11 @@ $(function() {
|
||||
return;
|
||||
}
|
||||
if(!pwd1 || !pwd2) {
|
||||
showMsg(getMsg("Password is required"), "pwd");
|
||||
showMsg(getMsg("Password is required"), "pwd1");
|
||||
return;
|
||||
} else {
|
||||
if(pwd1.length < 6 || pwd2.length < 6) {
|
||||
showMsg(getMsg("Username or Password Error"), "pwd");
|
||||
showMsg(getMsg("The minimum password length is 6"), "pwd1");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -214,7 +220,7 @@ $(function() {
|
||||
user.Username = username;
|
||||
user.Pwd = pwd1;
|
||||
user.IsLocal = true;
|
||||
UserService.saveNew(user, function(ret, dbuser) {
|
||||
UserService.createLocalUser(user, function(ret, dbuser) {
|
||||
if(ret) {
|
||||
dbuser.UserId = dbuser._id;
|
||||
UserService.saveCurUser(dbuser, function() {
|
||||
@@ -226,11 +232,13 @@ $(function() {
|
||||
})
|
||||
} else {
|
||||
$('#loadingLogo').removeClass('loading');
|
||||
showMsg(getMsg("Email or Password Error"));
|
||||
showMsg(getMsg(dbuser));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
var $loginBtnO = $("#loginBtn");
|
||||
var $regBtnO = $('#regBtn');
|
||||
function checkDisabled() {
|
||||
var email = $("#email").val();
|
||||
var pwd = $("#pwd").val();
|
||||
@@ -239,6 +247,16 @@ $(function() {
|
||||
} else {
|
||||
$loginBtnO.attr('disabled', false);
|
||||
}
|
||||
|
||||
// reg
|
||||
var username = $("#username").val();
|
||||
var pwd1 = $("#pwd1").val();
|
||||
var pwd2 = $('#pwd2').val();
|
||||
if (username && pwd1 && pwd2) {
|
||||
$regBtnO.attr('disabled', false);
|
||||
} else {
|
||||
$regBtnO.attr('disabled', true);
|
||||
}
|
||||
}
|
||||
|
||||
$('body, input').on('keydown', function() {
|
||||
@@ -252,20 +270,32 @@ $(function() {
|
||||
});
|
||||
});
|
||||
|
||||
var $body = $('body');
|
||||
|
||||
$('#customServer').click(function() {
|
||||
if($hostGroup.hasClass('hide')) {
|
||||
$hostGroup.removeClass('hide');
|
||||
hasHost = true;
|
||||
} else {
|
||||
$hostGroup.addClass('hide');
|
||||
hasHost = false;
|
||||
}
|
||||
$body.addClass('custom-server');
|
||||
$host.focus();
|
||||
hideMsg();
|
||||
});
|
||||
|
||||
$('#localAccount').click(function() {
|
||||
$('#logo').toggleClass('decolour');
|
||||
$('.boxForm').toggleClass ('hide');
|
||||
$body.addClass('local-account');
|
||||
$('#username').focus();
|
||||
hideMsg();
|
||||
});
|
||||
|
||||
$('#loginWithLeanote').click(function () {
|
||||
$body.removeClass('local-account custom-server');
|
||||
hasHost = false;
|
||||
$email.focus();
|
||||
hideMsg();
|
||||
});
|
||||
|
||||
// setTimeout(function () {
|
||||
// var s = $('<script>');
|
||||
// s.attr('src', 'public/js/app/service_login.js');
|
||||
// $body.append(s);
|
||||
// }, 1000);
|
||||
});
|
||||
|
||||
// win.resizeTo(268, 356);
|
||||
@@ -273,7 +303,8 @@ $(function() {
|
||||
|
||||
</script>
|
||||
|
||||
</div>
|
||||
<script src="public/js/app/service_login.js" defer="defer"></script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
16
src/main.js
16
src/main.js
@@ -4,6 +4,8 @@ var BrowserWindow = require('browser-window'); // Module to create native brows
|
||||
// Report crashes to our server.
|
||||
require('crash-reporter').start();
|
||||
|
||||
var debug = false;
|
||||
|
||||
// Keep a global reference of the window object, if you don't, the window will
|
||||
// be closed automatically when the javascript object is GCed.
|
||||
var mainWindow = null;
|
||||
@@ -16,7 +18,7 @@ app.on('window-all-closed', function() {
|
||||
|
||||
// 避免可以启动多个app
|
||||
app.on('open-file', function(e) {
|
||||
console.log('reopen');
|
||||
// console.log('reopen');
|
||||
if(mainWindow) {
|
||||
mainWindow.show();
|
||||
mainWindow.focus();
|
||||
@@ -218,10 +220,12 @@ function openIt() {
|
||||
// require('leanote_protocol');
|
||||
|
||||
// Create the browser window.
|
||||
mainWindow = new BrowserWindow({width: 1050,
|
||||
height: 595,
|
||||
frame: process.platform != 'darwin',
|
||||
transparent: false }
|
||||
mainWindow = new BrowserWindow({
|
||||
width: 1050,
|
||||
height: 595,
|
||||
frame: debug || process.platform != 'darwin',
|
||||
transparent: false
|
||||
}
|
||||
);
|
||||
|
||||
// and load the index.html of the app.
|
||||
@@ -265,5 +269,5 @@ function openIt() {
|
||||
});
|
||||
|
||||
// 作为调试
|
||||
// setMenu();
|
||||
debug && setMenu();
|
||||
}
|
||||
|
10
src/node_modules/db.js
generated
vendored
10
src/node_modules/db.js
generated
vendored
@@ -17,12 +17,16 @@ if(dbPath.length < 6) {
|
||||
// console.log(dbPath);
|
||||
// g, 表全局环境
|
||||
var db = {};
|
||||
var dbNames = ['notebooks', 'notes', 'users', 'tags', 'images', 'attachs', 'noteHistories', 'g'];
|
||||
var dbNames = ['users', 'notebooks', 'notes', 'tags', 'images', 'attachs', 'noteHistories', 'g'];
|
||||
for(var i in dbNames) {
|
||||
var name = dbNames[i];
|
||||
var p = path.join(dbPath, name + '.db');
|
||||
// console.log(p);
|
||||
db[name] = new Datastore({ filename: p, autoload: true });
|
||||
(function (name) {
|
||||
// 这部分非常慢!, 会卡界面
|
||||
db[name] = new Datastore({ filename: p, autoload: true , onload: function () {
|
||||
console.log(name + ' is loaded');
|
||||
}});
|
||||
})(name);
|
||||
}
|
||||
module.exports = db;
|
||||
console.log('db inited');
|
12
src/node_modules/user.js
generated
vendored
12
src/node_modules/user.js
generated
vendored
@@ -51,12 +51,12 @@ User = {
|
||||
//FIXME 鉴于服务器端也是明文密码,暂时用明文,安全性堪忧
|
||||
db.users.count({Username: username, Pwd: password},
|
||||
function(err, count) {
|
||||
log('login failed: ' + count);
|
||||
log(err);
|
||||
// log('login failed: ' + count);
|
||||
// log(err);
|
||||
callback && callback(count == 1);
|
||||
});
|
||||
},
|
||||
saveNew: function(user, callback) {
|
||||
createLocalUser: function(user, callback) {
|
||||
// 当前用户是否在数据库中
|
||||
db.users.count({Username: user.Username}, function(err, count) {
|
||||
if(count == 0) {
|
||||
@@ -65,9 +65,9 @@ User = {
|
||||
callback && callback(!err, doc);
|
||||
});
|
||||
} else {
|
||||
log('save new user failed: username exists')
|
||||
log(err);
|
||||
callback && callback(false);
|
||||
// log('save new user failed: username exists')
|
||||
// log(err);
|
||||
callback && callback(false, 'User exists');
|
||||
}
|
||||
});
|
||||
},
|
||||
|
@@ -337,6 +337,14 @@ input,
|
||||
margin-bottom: 30px;
|
||||
width: 248px;
|
||||
color: #eee;
|
||||
height: 102px;
|
||||
text-align: center;
|
||||
}
|
||||
#box h1 span {
|
||||
display: none;
|
||||
font-size: 24px;
|
||||
color: #000;
|
||||
line-height: 102px;
|
||||
}
|
||||
#boxHeader {
|
||||
border-color: #e8e8e8;
|
||||
@@ -772,11 +780,12 @@ form {
|
||||
#loginMsg {
|
||||
margin: auto;
|
||||
padding: 0;
|
||||
padding-bottom: 5px;
|
||||
text-align: center;
|
||||
}
|
||||
.bottom {
|
||||
position: absolute;
|
||||
bottom: 5px;
|
||||
bottom: 10px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
text-align: center;
|
||||
@@ -784,9 +793,46 @@ form {
|
||||
.bottom a {
|
||||
color: #666;
|
||||
font-size: 85%;
|
||||
display: block;
|
||||
}
|
||||
.decolour {
|
||||
-webkit-filter: grayscale(100%);
|
||||
.bottom .loginWithLeanote {
|
||||
display: none;
|
||||
}
|
||||
.host-group,
|
||||
.local-form {
|
||||
display: none;
|
||||
}
|
||||
.local-account .bottom a,
|
||||
.custom-server .bottom a {
|
||||
display: none;
|
||||
}
|
||||
.local-account .bottom .loginWithLeanote,
|
||||
.custom-server .bottom .loginWithLeanote {
|
||||
display: block;
|
||||
}
|
||||
.custom-server .host-group {
|
||||
display: block;
|
||||
}
|
||||
.custom-server .btns {
|
||||
display: none;
|
||||
}
|
||||
.custom-server #loadingLogo {
|
||||
display: none;
|
||||
}
|
||||
.custom-server #box h1 span.customServer {
|
||||
display: block;
|
||||
}
|
||||
.local-account .local-form {
|
||||
display: block;
|
||||
}
|
||||
.local-account .leanote-form {
|
||||
display: none;
|
||||
}
|
||||
.local-account #loadingLogo {
|
||||
display: none;
|
||||
}
|
||||
.local-account #box h1 span.localAccount {
|
||||
display: block;
|
||||
}
|
||||
.win-tool {
|
||||
padding: 5px;
|
||||
@@ -844,3 +890,17 @@ form {
|
||||
.blur .win-tool a {
|
||||
background: url(icon/traffic-disabled@2x.png);
|
||||
}
|
||||
body #container {
|
||||
margin: 0 auto;
|
||||
border-radius: 0;
|
||||
box-shadow: none;
|
||||
border: none;
|
||||
}
|
||||
html,
|
||||
body {
|
||||
overflow: hidden;
|
||||
background-color: rgba(247, 249, 250, 0.99);
|
||||
}
|
||||
.drag {
|
||||
left: 50px;
|
||||
}
|
||||
|
@@ -344,6 +344,15 @@ input, .form-control {
|
||||
margin-bottom: 30px;
|
||||
width: @boxWidth;;
|
||||
color: #eee;
|
||||
|
||||
height: 102px;
|
||||
text-align: center;
|
||||
span {
|
||||
display: none;
|
||||
font-size: 24px;
|
||||
color: #000;
|
||||
line-height: 102px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -849,23 +858,90 @@ form {
|
||||
//position: absolute;
|
||||
margin: auto;
|
||||
padding: 0;
|
||||
padding-bottom: 5px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.bottom {
|
||||
position: absolute;
|
||||
bottom: 5px;
|
||||
bottom: 10px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
text-align: center;
|
||||
a {
|
||||
color: #666;
|
||||
font-size: 85%;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.loginWithLeanote {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.decolour {
|
||||
-webkit-filter: grayscale(100%);
|
||||
.host-group, .local-form {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.local-account, .custom-server {
|
||||
.bottom {
|
||||
a {
|
||||
display: none;
|
||||
}
|
||||
.loginWithLeanote {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.custom-server {
|
||||
.host-group {
|
||||
display: block;
|
||||
}
|
||||
.btns {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#loadingLogo {
|
||||
display: none;
|
||||
}
|
||||
#box h1 span.customServer {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
.local-account {
|
||||
.local-form {
|
||||
display: block;
|
||||
}
|
||||
.leanote-form {
|
||||
display: none;
|
||||
}
|
||||
|
||||
// #loadingLogo {
|
||||
// -webkit-filter: grayscale(100%);
|
||||
// }
|
||||
|
||||
#loadingLogo {
|
||||
display: none;
|
||||
}
|
||||
#box h1 span.localAccount {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
@import "traffic.less";
|
||||
|
||||
body #container {
|
||||
margin: 0 auto;
|
||||
border-radius: 0;
|
||||
box-shadow: none;
|
||||
border: none;
|
||||
}
|
||||
|
||||
html, body {
|
||||
overflow: hidden;
|
||||
background-color: rgba(247, 249, 250, 0.99);
|
||||
}
|
||||
.drag {
|
||||
left: 50px;
|
||||
}
|
||||
|
@@ -15,7 +15,6 @@ if(!/login.html/.test(location.href)) {
|
||||
var Service = {
|
||||
notebookService: require('notebook'),
|
||||
noteService: require('note'),
|
||||
tagService: require('tag'),
|
||||
userService: require('user'),
|
||||
tagService: require('tag'),
|
||||
apiService: require('api'),
|
||||
|
20
src/public/js/app/service_login.js
Normal file
20
src/public/js/app/service_login.js
Normal file
@@ -0,0 +1,20 @@
|
||||
var Common = require('common');
|
||||
|
||||
var Evt = require('evt');
|
||||
var app = require('remote').require('app');
|
||||
var basePath = app.getPath('appData') + '/leanote'; // /Users/life/Library/Application Support/Leanote'; // require('nw.gui').App.dataPath;
|
||||
Evt.setDataBasePath(basePath);
|
||||
|
||||
// 所有service, 与数据库打交道
|
||||
var Service = {
|
||||
userService: require('user'),
|
||||
apiService: require('api'),
|
||||
};
|
||||
|
||||
// 全局变量
|
||||
var ApiService = Service.apiService;
|
||||
var UserService = Service.userService;
|
||||
var EvtService = require('evt');
|
||||
var CommonService = Common;
|
||||
|
||||
var gui = require('gui');
|
@@ -984,7 +984,7 @@ var email2LoginAddress = {
|
||||
'eyou.com': 'http://www.eyou.com/',
|
||||
'21cn.com': 'http://mail.21cn.com/',
|
||||
'188.com': 'http://www.188.com/',
|
||||
'foxmail.coom': 'http://www.foxmail.com'
|
||||
'foxmail.com': 'http://www.foxmail.com'
|
||||
};
|
||||
|
||||
function getEmailLoginAddress(email) {
|
||||
@@ -1466,13 +1466,12 @@ function goToMainPage() {
|
||||
function switchAccount() {
|
||||
SyncService.stop();
|
||||
// location.href = 'login.html';
|
||||
//
|
||||
var BrowserWindow = gui.remote.require('browser-window');
|
||||
if(isMac()) {
|
||||
var win = new BrowserWindow({ width: 278, height: 316, show: true, frame: false, resizable: false });
|
||||
var win = new BrowserWindow({ width: 278, height: 326, show: true, frame: false, resizable: false });
|
||||
win.loadUrl('file://' + __dirname + '/login.html');
|
||||
} else {
|
||||
var win = new BrowserWindow({ width: 278, height: 416, show: true, frame: true, resizable: false });
|
||||
var win = new BrowserWindow({ width: 278, height: 426, show: true, frame: true, resizable: false });
|
||||
win.loadUrl('file://' + __dirname + '/login.html');
|
||||
}
|
||||
gui.getCurrentWindow().close();
|
||||
|
Reference in New Issue
Block a user