simplified console UI
This commit is contained in:
@@ -80,6 +80,7 @@ function tokenValidation (req, res, next) {
|
||||
// request of content type of multipart/form-data would be validated inside each service
|
||||
next();
|
||||
} else {
|
||||
console.log("adminID = " + adminID + ", token = " + token);
|
||||
certificateLogic.verifyTokenWorkUnit(adminID, token, function(validateTokenErr) {
|
||||
if(errorCode.SUCCESS.code != validateTokenErr.code) {
|
||||
var fakeResponse = {
|
||||
|
||||
@@ -22,10 +22,7 @@
|
||||
<div class="header clearfix">
|
||||
<nav>
|
||||
<ul class="nav nav-pills pull-right">
|
||||
<li role="presentation"><a href="#" onclick="gotoIndex();">主页</a></li>
|
||||
<li role="presentation" class="active"><a href="#">控制台</a></li>
|
||||
<li role="presentation"><a href="#">文档</a></li>
|
||||
<li role="presentation"><a href="https://github.com/strawmanbobi/irext">Github</a></li>
|
||||
<li role="presentation"><a href="#" onclick="gotoIndex();">退出</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<h3>IRext</h3>
|
||||
|
||||
@@ -1760,5 +1760,5 @@ function translateToTC(textID, targetTextID) {
|
||||
}
|
||||
|
||||
function gotoIndex() {
|
||||
window.location = '../index.html?admin_id='+id+'&token='+token;
|
||||
window.location = '../';
|
||||
}
|
||||
@@ -16,111 +16,25 @@
|
||||
<body>
|
||||
<div class="navbar container">
|
||||
<div class="header clearfix">
|
||||
<nav>
|
||||
<ul class="nav nav-pills pull-right">
|
||||
<li role="presentation" class="active"><a href="#">主页</a></li>
|
||||
<li role="presentation"><a href="#" onclick="onSignIn();">控制台</a></li>
|
||||
<li role="presentation"><a href="#">文档</a></li>
|
||||
<li role="presentation"><a href="https://github.com/strawmanbobi/irext">Github</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<h3>IRext</h3>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Main jumbotron for a primary marketing message or call to action -->
|
||||
<div class="jumbotron" style="background: #3FAF7F">
|
||||
<div class="container">
|
||||
<h1 style="text-shadow: none; color: #FFF;">IRext</h1>
|
||||
<p class="lead" style="text-shadow: none; color: #FFF;">开源家用电器红外的编码、解码和索引方案.</p>
|
||||
<br>
|
||||
<p><a class="btn btn-default" style="color: #000;" href="#" role="button">看看数据先</a></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container">
|
||||
<div class="row marketing">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<h2>红外编码</h2>
|
||||
<p>基于XML的编码输入语言</p>
|
||||
<p>支持远程录入</p>
|
||||
<p>支持红外分析仪插件</p>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h2>红外解码</h2>
|
||||
<p>支持多种平台下的解码</p>
|
||||
<p>极小的内存开销</p>
|
||||
<p>高性能解码</p>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h2>码库索引</h2>
|
||||
<p>利用Web控制台录入码库</p>
|
||||
<p>规范的码库审核和发布流程</p>
|
||||
<p>支持协议扩充</p>
|
||||
</div>
|
||||
<div class="container">
|
||||
<div class="form-signin">
|
||||
<h4 class="text-muted">登入</h4>
|
||||
<label for="user_name" class="sr-only">邮件地址</label>
|
||||
<input type="email" id="user_name" class="form-control" placeholder="邮件地址" required autofocus>
|
||||
<label for="password" class="sr-only">密码</label>
|
||||
<input type="password" id="password" class="form-control" placeholder="密码" required>
|
||||
<button class="btn btn-lg btn-primary btn-block" onclick="signIn();">确定</button>
|
||||
<br>
|
||||
<div style="font-size: 12px; color: #AAA;"><a href="#" onclick="onChangePassword();">更改密码</a></div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<h2>码库支持</h2>
|
||||
<p>支持13种电器类型</p>
|
||||
<p>支持数百个品牌</p>
|
||||
<p>支持上万种型号家电</p>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h2>扩展功能</h2>
|
||||
<p>支持基于开源硬件的IR学习</p>
|
||||
<p>提供远程编码服务</p>
|
||||
<p>代码完全开源</p>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h2>易于上手</h2>
|
||||
<p>仅需几步就能移植到您的项目</p>
|
||||
<p>Web服务接口文档</p>
|
||||
<p>提供开放式控制台和示例代码</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
<p>Strawmanbobi, 2016</p>
|
||||
</footer>
|
||||
</div> <!-- /container -->
|
||||
</div>
|
||||
|
||||
<!-- dialogs -->
|
||||
<div class="modal fade" id="signin_dialog" role="dialog" aria-labelledby="myModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title" style="color: #000; text-shadow: none;">登入控制台</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-signin">
|
||||
<label for="user_name" class="sr-only">邮件地址</label>
|
||||
<input type="email" id="user_name" class="form-control" placeholder="邮件地址" required autofocus>
|
||||
<label for="password" class="sr-only">密码</label>
|
||||
<input type="password" id="password" class="form-control" placeholder="密码" required>
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input id="remember_me" type="checkbox" checked="true">
|
||||
<div style="font-size: 12px; color: #000; text-decoration: none; text-shadow: none;">
|
||||
记住我
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
<button class="btn btn-normal btn-success" onclick="signIn();">确定</button>
|
||||
<button class="btn btn-normal btn-primary" onclick="onChangePassword();">忘记密码</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary" data-dismiss="modal">取消</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="changepw_confirm_dialog" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
|
||||
@@ -121,10 +121,8 @@ function doSignIn(userName, password) {
|
||||
setTimeout(function() {
|
||||
navigateToPage(page, adminID, token);
|
||||
}, 3000);
|
||||
if($("#remember_me").is(":checked")) {
|
||||
localStorage.setItem(LS_KEY_ID, adminID);
|
||||
localStorage.setItem(LS_KEY_TOKEN, token);
|
||||
}
|
||||
localStorage.setItem(LS_KEY_ID, adminID);
|
||||
localStorage.setItem(LS_KEY_TOKEN, token);
|
||||
} else {
|
||||
toastr.error("登入失败,请确认密码是否正确");
|
||||
}
|
||||
|
||||
@@ -46,8 +46,7 @@ exports.adminLoginWorkUnit = function (userName, password, callback) {
|
||||
timeStamp,
|
||||
name;
|
||||
timeStamp = new Date().getTime();
|
||||
token = MD5.MD5(password + timeStamp);
|
||||
token += "," + admin.permissions;
|
||||
token = admin.token;
|
||||
key = "admin_" + admin.id;
|
||||
adminAuth.setAuthInfo(key, token, ttl, function(setAdminAuthErr) {
|
||||
if (errorCode.SUCCESS.code == setAdminAuthErr.code) {
|
||||
|
||||
Reference in New Issue
Block a user