Skip to content

Commit

Permalink
准备发布版本v2.1.2.1。
Browse files Browse the repository at this point in the history
  • Loading branch information
apexliu committed Mar 29, 2017
1 parent 61c1b69 commit f80e12c
Show file tree
Hide file tree
Showing 20 changed files with 54 additions and 675 deletions.
4 changes: 2 additions & 2 deletions build/builder/core/ver.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# -*- coding: utf8 -*-
VER_TELEPORT_SERVER = "2.1.0.1"
VER_TELEPORT_ASSIST = "2.1.0.1"
VER_TELEPORT_SERVER = "2.1.2.1"
VER_TELEPORT_ASSIST = "2.1.2.1"
Binary file modified client/tp_assist/tp_assist.rc
Binary file not shown.
2 changes: 1 addition & 1 deletion client/tp_assist/ts_ver.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifndef __TS_ASSIST_VER_H__
#define __TS_ASSIST_VER_H__

#define TP_ASSIST_VER L"2.1.0.1"
#define TP_ASSIST_VER L"2.1.2.1"

#endif // __TS_ASSIST_VER_H__
Binary file modified dist/client/windows/assist/installer.nsi
Binary file not shown.
Binary file modified server/tp_core/core/tp_core.rc
Binary file not shown.
6 changes: 0 additions & 6 deletions server/tp_core/core/ts_http_rpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,6 @@ void TsHttpRpc::_mg_event_handler(struct mg_connection *nc, int ev, void *ev_dat
{
ex_astr ret_buf;

//const char* dbg_method = NULL;
// ex_chars _uri;
// _uri.resize(hm->uri.len + 1);
// memset(&_uri[0], 0, hm->uri.len + 1);
// memcpy(&_uri[0], hm->uri.p, hm->uri.len);
// ex_astr uri = &_uri[0];
ex_astr uri;
uri.assign(hm->uri.p, hm->uri.len);

Expand Down
2 changes: 1 addition & 1 deletion server/tp_core/core/ts_ver.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifndef __TS_SERVER_VER_H__
#define __TS_SERVER_VER_H__

#define TP_SERVER_VER L"2.1.0.1"
#define TP_SERVER_VER L"2.1.2.1"

#endif // __TS_SERVER_VER_H__
Binary file modified server/tp_web/src/tp_web.rc
Binary file not shown.
2 changes: 1 addition & 1 deletion server/tp_web/src/ts_ver.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifndef __TS_SERVER_VER_H__
#define __TS_SERVER_VER_H__

#define TP_SERVER_VER L"2.1.0.1"
#define TP_SERVER_VER L"2.1.2.1"

#endif // __TS_SERVER_VER_H__
6 changes: 5 additions & 1 deletion server/www/teleport/app/eom_app/controller/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def post(self):
captcha = args['captcha']
username = args['username']
userpwd = args['userpwd']
remember = args['remember']
else:
self.write_json(-1, '系统内部错误')
return
Expand Down Expand Up @@ -83,7 +84,10 @@ def post(self):
_user['nick_name'] = nickname
_user['type'] = account_type

self.set_session('user', _user)
if remember:
self.set_session('user', _user, 12*60*60)
else:
self.set_session('user', _user)
return self.write_json(0)

except:
Expand Down
4 changes: 2 additions & 2 deletions server/www/teleport/app/eom_ver.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf8 -*-
TS_VER = "2.1.0.1"
TP_ASSIST_LAST_VER = "2.1.0.1"
TS_VER = "2.1.2.1"
TP_ASSIST_LAST_VER = "2.1.2.1"
TP_ASSIST_REQUIRE = "2.0.0.1"
6 changes: 3 additions & 3 deletions server/www/teleport/static/js/ui/admin_host.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ ywl.on_init = function (cb_stack, cb_args) {

var _ver_obj = $("#tp-assist-version");
var last_version = _ver_obj.text();
var low_version = _ver_obj.attr("low-version");
var req_version = _ver_obj.attr("req-version");

teleport_init(last_version, low_version,
teleport_init(last_version, req_version,
function (ret) {
$("#tp-assist-current-version").text("当前助手版本:" + ret.version);
},
Expand All @@ -77,7 +77,7 @@ ywl.on_init = function (cb_stack, cb_args) {
g_assist.alert_assist_not_found();
} else if (code == TPE_OLD_ASSIST) {
ywl.notify_error(error);
$('#tp-assist-current-version').html('当前助手版本太低(v' + ret.version + '),请<a href="http://teleport.eomsoft.net/static/download/teleport-assist-last-win.zip">下载最新版本</a>!');
$('#tp-assist-current-version').html('当前助手版本太低(v' + ret.version + '),请<a target="_blank" href="http://teleport.eomsoft.net/download">下载最新版本</a>!');
} else {
$("#tp-assist-current-version").text('检测TP助手版本时发生错误!');
ywl.notify_error(error);
Expand Down
75 changes: 24 additions & 51 deletions server/www/teleport/static/js/ui/auth/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,30 +53,34 @@ ywl.create_app = function () {
var str_username = '';
var str_password = '';
var str_captcha = '';
var is_remember = false;

var dom_username = $('#username_account');
var dom_password = $('#password_account');
var dom_captcha = $('#captcha');
var dom_remember = $('#remember-me');

str_username = dom_username.val();
str_password = dom_password.val();
str_captcha = dom_captcha.val();
is_remember = dom_remember.is(':checked');
console.log('xxxx', is_remember);

if (str_username.length == 0) {
if (str_username.length === 0) {
show_op_box('error', '缺少账号!');
dom_username.attr('data-content', "请填写您的账号!").popover('show');
dom_username.focus();
return;
}

if (str_password.length == 0) {
if (str_password.length === 0) {
show_op_box('error', '缺少密码!');
dom_password.attr('data-content', "请填写密码!").popover('show');
dom_password.focus();
return;
}

if (str_captcha.length != 4) {
if (str_captcha.length !== 4) {
show_op_box('error', '验证码错误!');
dom_captcha.attr('data-content', "验证码为4位数字和字母的组合,请重新填写!").popover('show').focus();
return;
Expand All @@ -86,13 +90,13 @@ ywl.create_app = function () {
show_op_box('wait', '<i class="fa fa-circle-o-notch fa-spin"></i> 正在进行身份认证,请稍候...');

// 先判断一下captcha是否正确,如果不正确,拒绝登录
ywl.ajax_post_json('/auth/verify-captcha', {captcha: str_captcha},
function (ret) {
if (ret.code == 0) {
ywl.ajax_post_json('/auth/verify-captcha', {captcha: str_captcha},
function (ret) {
if (ret.code === 0) {
// 验证成功
hide_op_box();
show_op_box('wait', '<i class="fa fa-circle-o-notch fa-spin"></i> 正在登录TELEPORT,请稍候...');
_app.do_account_login(str_username, str_password, str_captcha);
_app.do_account_login(str_username, str_password, str_captcha, is_remember);
}
else {
hide_op_box();
Expand All @@ -102,68 +106,37 @@ ywl.create_app = function () {
}

$('#btn_login').removeAttr('disabled');
},
function () {
},
function () {
hide_op_box();
show_op_box('error', '很抱歉,无法连接服务器!请稍后再试一次!');
$('#btn_login').removeAttr('disabled');
}
);

// $.ajax({
// type: 'GET',
// url: '/auth/verify-captcha',
// jsonp: "callback",
// //jsonpCallback:"login_ret",
// data: {captcha: str_captcha},
// dataType: 'jsonp',
// success: function (data) {
// if (data.code == 0) {
// // 验证成功
// hide_op_box();
// show_op_box('wait', '<i class="fa fa-circle-o-notch fa-spin"></i> 正在登录TELEPORT,请稍候...');
// _app.do_account_login(str_username, str_password, str_captcha);
// }
// else {
// hide_op_box();
// show_op_box('error', '验证码错误!');
// // renew the captcha.
// //change_captcha();
// $('#captcha_image').attr('src', '/auth/get-captcha?' + Math.random());
// $('#captcha').focus().val('');
// }
//
// $('#btn_login').removeAttr('disabled');
// },
// error: function () {
// hide_op_box();
// show_op_box('error', '很抱歉,无法连接服务器!请稍后再试一次!');
// $('#btn_login').removeAttr('disabled');
// }
// });
}
);
};

_app.do_account_login = function (username, userpwd, captcha) {
ywl.ajax_post_json('/auth/verify-user', {username: username, userpwd: userpwd, captcha: captcha},
function (ret) {
_app.do_account_login = function (username, userpwd, captcha, is_remember) {
console.log('remember', is_remember);
ywl.ajax_post_json('/auth/verify-user', {username: username, userpwd: userpwd, captcha: captcha, remember: is_remember},
function (ret) {
if (ret.code == 0) {
// 验证成功
window.location.href = ywl.page_options.ref;
}
else {
hide_op_box();
show_op_box('error', '无法登录TELEPORT:'+ret.message);
show_op_box('error', '无法登录TELEPORT:' + ret.message);
console.log(ret);
}

$('#btn_login').removeAttr('disabled');
},
function () {
},
function () {
hide_op_box();
show_op_box('error', '很抱歉,无法连接服务器!请稍后再试一次!');
$('#btn_login').removeAttr('disabled');
}
);
}
);

// $.ajax({
// type: 'GET',
Expand Down
6 changes: 3 additions & 3 deletions server/www/teleport/static/js/ui/common_host.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ ywl.on_init = function (cb_stack, cb_args) {
g_assist = ywl.create_assist();

var last_version = $("#tp-assist-version").text();
var low_version = $("#tp-assist-version").attr("low-version");
var req_version = $("#tp-assist-version").attr("req-version");

teleport_init(last_version, low_version,
teleport_init(last_version, req_version,
function (ret) {
$("#tp-assist-current-version").text("当前助手版本:" + ret.version);
},
Expand All @@ -29,7 +29,7 @@ ywl.on_init = function (cb_stack, cb_args) {
}
else if (code == TPE_OLD_ASSIST) {
ywl.notify_error(error);
$('#tp-assist-current-version').html('当前助手版本太低(v' + ret.version + '),请<a href="http://teleport.eomsoft.net/static/download/teleport-assist-last-win.zip">下载最新版本</a>!');
$('#tp-assist-current-version').html('当前助手版本太低(v' + ret.version + '),请<a target="_blank" href="http://teleport.eomsoft.net/download">下载最新版本</a>!');
}
else {
$("#tp-assist-current-version").text(error);
Expand Down
15 changes: 6 additions & 9 deletions server/www/teleport/static/js/ui/teleport.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict";

var g_low_version = "";
var g_req_version = "";
var g_last_version = "";
var g_current_version = "";

Expand All @@ -27,9 +27,9 @@ var error_process = function (ret, func_success, func_error) {
}
};

var teleport_init = function (low_version, last_version, func_success, func_error) {
var teleport_init = function (last_version, req_version, func_success, func_error) {

g_low_version = low_version;
g_req_version = req_version;
g_last_version = last_version;
var data = {};
var args_ = encodeURIComponent(JSON.stringify(data));
Expand All @@ -41,11 +41,10 @@ var teleport_init = function (low_version, last_version, func_success, func_erro
dataType: 'json',
success: function (ret) {
g_current_version = ret.version;
console.log("current_version", g_current_version);
if (version_compare()) {
error_process(ret, func_success, func_error);
} else {
func_error(ret, TPE_OLD_ASSIST, '助手版本太低,请<a style="color:#aaaaff;" href="http://teleport.eomsoft.net/static/download/teleport-assist-last-win.zip">下载最新版本</a>!');
func_error(ret, TPE_OLD_ASSIST, '助手版本太低,请<a style="color:#aaaaff;" target="_blank" href="http://teleport.eomsoft.net/download">下载最新版本</a>!');
}
},
error: function (jqXhr) {
Expand All @@ -55,11 +54,9 @@ var teleport_init = function (low_version, last_version, func_success, func_erro
};

var version_compare = function () {

var cur_version = parseInt(g_current_version.split(".")[2]);
// var last_version = parseInt(g_last_version.split(".")[2]);
var low_version = parseInt(g_low_version.split(".")[2]);
return cur_version >= low_version;
var req_version = parseInt(g_req_version.split(".")[2]);
return cur_version >= req_version;
};

var to_teleport = function (url, args, func_success, func_error) {
Expand Down
2 changes: 1 addition & 1 deletion server/www/teleport/view/auth/login.mako
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

<div class="inputbox">
<div class="checkbox">
<label><input type="checkbox" value=""> 记住我,12小时内无需重新登录。</label>
<label><input id="remember-me" type="checkbox" value=""> 记住我,12小时内无需重新登录。</label>
</div>
</div>

Expand Down
Loading

0 comments on commit f80e12c

Please sign in to comment.