updated response handle for admin and db - 1
This commit is contained in:
@@ -21,7 +21,7 @@ exports.setupEnvironment = function () {
|
||||
MYSQL_DB_PASSWORD = "root";
|
||||
FILE_TEMP_PATH = "~/home/strawmanbobi/rc_extension";
|
||||
PYTHON_PATH = "/usr/bin/python";
|
||||
LISTEN_PORT = "8300";
|
||||
LISTEN_PORT = "80";
|
||||
SERVER_ADDRESS = "localhost";
|
||||
REDIS_HOST = "localhost";
|
||||
REDIS_PORT = "6379";
|
||||
@@ -35,13 +35,13 @@ exports.setupEnvironment = function () {
|
||||
MYSQL_DB_PASSWORD = "root";
|
||||
FILE_TEMP_PATH = "D:/rc_extension";
|
||||
PYTHON_PATH = "C:/Python27/python.exe";
|
||||
LISTEN_PORT = "8300";
|
||||
LISTEN_PORT = "80";
|
||||
SERVER_ADDRESS = "localhost";
|
||||
REDIS_HOST = "localhost";
|
||||
REDIS_PORT = "6379";
|
||||
REDIS_PASSWORD = "";
|
||||
EXTERNAL_SERVER_ADDRESS = "www.strawmanbobi.com";
|
||||
EXTERNAL_SERVER_PORT = "8200"
|
||||
EXTERNAL_SERVER_PORT = "8300"
|
||||
} else if (enums.APP_USERDEBUG_MODE == env) {
|
||||
MYSQL_DB_SERVER_ADDRESS = "localhost";
|
||||
MYSQL_DB_NAME = "irext";
|
||||
@@ -49,12 +49,12 @@ exports.setupEnvironment = function () {
|
||||
MYSQL_DB_PASSWORD = "root";
|
||||
FILE_TEMP_PATH = "D:/rc_extension";
|
||||
PYTHON_PATH = "/usr/bin/python";
|
||||
LISTEN_PORT = "8300";
|
||||
LISTEN_PORT = "80";
|
||||
SERVER_ADDRESS = "localhost";
|
||||
REDIS_HOST = "localhost";
|
||||
REDIS_PORT = "6379";
|
||||
REDIS_PASSWORD = "";
|
||||
EXTERNAL_SERVER_ADDRESS = "www.strawmanbobi.com";
|
||||
EXTERNAL_SERVER_PORT = "8200"
|
||||
EXTERNAL_SERVER_PORT = "8300"
|
||||
}
|
||||
};
|
||||
@@ -19,23 +19,6 @@ DROP database IF EXISTS `irext`;
|
||||
CREATE database `irext`;
|
||||
use `irext`;
|
||||
|
||||
--
|
||||
-- Table structure for table `admin`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `admin`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `admin` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`user_name` varchar(64) NOT NULL,
|
||||
`password` varchar(32) DEFAULT NULL,
|
||||
`permissions` varchar(64) DEFAULT NULL,
|
||||
`admin_type` tinyint(4) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `admin`
|
||||
--
|
||||
@@ -39,13 +39,12 @@ exports.adminLoginWorkUnit = function (userName, password, callback) {
|
||||
requestSender.sendPostRequest(signinInfo,
|
||||
function(signInRequestErr, signInResponse) {
|
||||
if (signInRequestErr == errorCode.SUCCESS.code && null != signInResponse) {
|
||||
var admin = signInResponse;
|
||||
var admin = JSON.parse(signInResponse).entity;
|
||||
var userID,
|
||||
token,
|
||||
key,
|
||||
ttl = 24 * 60 * 60 * 14,
|
||||
timeStamp,
|
||||
admin;
|
||||
timeStamp;
|
||||
timeStamp = new Date().getTime();
|
||||
token = MD5.MD5(password + timeStamp);
|
||||
token += "," + admin.permissions;
|
||||
|
||||
Reference in New Issue
Block a user