Skip to content

Commit ec87b9e

Browse files
committed
OKOK
1 parent 858ce6e commit ec87b9e

File tree

110 files changed

+66
-959
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+66
-959
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -299,4 +299,7 @@ CMakeFiles/**
299299
*.depend
300300
*.stamp
301301
CMakeCache.txt
302+
303+
304+
release_egret/**
302305
*.sln

browser/SeasHandler.cpp

+49-50
Original file line numberDiff line numberDiff line change
@@ -58,62 +58,50 @@ bool CefV8HandlerImpl::Execute(const CefString& name //JavaScript calling funct
5858
if (arguments.size() == 2 && arguments[0]->IsString() && arguments[1]->IsString()) {
5959
std::string userName = arguments[0]->GetStringValue();
6060
std::string passWord = arguments[1]->GetStringValue();
61+
62+
CefRefPtr<CefV8Value> ret = CefV8Value::CreateObject(NULL, NULL);
63+
6164
if (userName.length() > 0 && passWord.length() > 0) {
6265
//用户名、密码有效 ,展开登陆逻辑, 操作结束后,返回retval
63-
// Create a new V8 string value. See the "Basic JS Types" section below.
6466
CefRefPtr<CefV8Value> str = CefV8Value::CreateString("1.0.7a");
65-
//userName = "aaa";
66-
//sqlite3_exec();
67-
68-
69-
70-
sqlite3 *db;
71-
char *zErrMsg = 0;
72-
int rc;
73-
char *sql;
67+
ret->SetValue("version", str, V8_PROPERTY_ATTRIBUTE_NONE);
68+
69+
sqlite3 *db; char *zErrMsg = 0; int rc; char *sql;
7470

7571
/* Open database */
7672
rc = sqlite3_open("test.db", &db);
73+
std::string errmsg;
7774
if (rc) {
78-
fprintf(stderr, "Can't open database: %s\n", sqlite3_errmsg(db));
79-
exit(0);
80-
}
81-
else {
82-
fprintf(stdout, "Opened database successfully\n");
83-
}
84-
85-
/* Create SQL statement */
86-
sql = "CREATE TABLE COMPANY(" \
87-
"ID INT PRIMARY KEY NOT NULL," \
88-
"NAME TEXT NOT NULL," \
89-
"AGE INT NOT NULL," \
90-
"ADDRESS CHAR(50)," \
91-
"SALARY REAL );";
92-
93-
/* Execute SQL statement */
94-
rc = sqlite3_exec(db, sql, SeasResourceHandler::c0allback, 0, &zErrMsg);
95-
if (rc != SQLITE_OK) {
96-
fprintf(stderr, "SQL error: %s\n", zErrMsg);
97-
sqlite3_free(zErrMsg);
98-
}
99-
else {
100-
fprintf(stdout, "Table created successfully\n");
101-
}
102-
sqlite3_close(db);
103-
104-
105-
106-
107-
108-
109-
110-
//std::string sql = "SELECT FROM users WHERE usernmae = '"+userName+"'";
111-
//std::string sql = "SELECT FROM users WHERE usernmae = 'aaa'";
112-
//{equipId:182, group:1, name:"louxiadaxingjiqiyihao", delay:100, period :1000 }
113-
//sqlite_exec_sql(sql);
114-
CefRefPtr<CefV8Value> ret = CefV8Value::CreateObject(NULL,NULL);
115-
ret->SetValue("ret", CefV8Value::CreateInt(1000), V8_PROPERTY_ATTRIBUTE_NONE);
116-
SeaCefUtils::setStatus( "ss" ); // 标记登陆成功
75+
errmsg = "Can't open database: \n";
76+
errmsg += CefString(sqlite3_errmsg(db));
77+
ret->SetValue("ret", CefV8Value::CreateInt(-920), V8_PROPERTY_ATTRIBUTE_NONE);
78+
}else {
79+
errmsg = "Opened database successfully\n";
80+
/* Create SQL statement */
81+
sql = "CREATE TABLE COMPANY(" \
82+
"ID INT PRIMARY KEY NOT NULL," \
83+
"NAME TEXT NOT NULL," \
84+
"AGE INT NOT NULL," \
85+
"ADDRESS CHAR(50)," \
86+
"SALARY REAL );";
87+
ret->SetValue("sql", CefV8Value::CreateString(sql), V8_PROPERTY_ATTRIBUTE_NONE);
88+
89+
/* Execute SQL statement */
90+
std::string exec_msg;
91+
rc = sqlite3_exec(db, sql, SeasResourceHandler::c0allback, 0, &zErrMsg);
92+
if (rc != SQLITE_OK) {
93+
exec_msg = "SQL error: %s\n";
94+
exec_msg += zErrMsg;
95+
sqlite3_free(zErrMsg);
96+
} else {
97+
exec_msg = "Table created successfully\n";
98+
}
99+
sqlite3_close(db);
100+
ret->SetValue("db_exec_msg", CefV8Value::CreateString(exec_msg), V8_PROPERTY_ATTRIBUTE_NONE);
101+
ret->SetValue("ret", CefV8Value::CreateInt(1000), V8_PROPERTY_ATTRIBUTE_NONE);
102+
SeaCefUtils::setStatus("login" + userName); // 标记登陆成功
103+
}
104+
ret->SetValue("db_open_msg", CefV8Value::CreateString(errmsg), V8_PROPERTY_ATTRIBUTE_NONE);
117105
retval = ret;
118106
handle = true;
119107
}
@@ -130,7 +118,7 @@ bool CefV8HandlerImpl::Execute(const CefString& name //JavaScript calling funct
130118
}else if (name == "SEA_userstatus") {
131119

132120
CefRefPtr<CefV8Value> ret = CefV8Value::CreateObject(NULL, NULL);
133-
if (SeaCefUtils::getStatus() == "ss") { // 检查登陆状态
121+
if (SeaCefUtils::getStatus().substr(0,5) == "login") { // 检查登陆状态
134122
//Values are assigned to an array using the SetValue() method variant that takes an index as the first argument.
135123
// Add two values to the array.
136124
ret->SetValue("ret", CefV8Value::CreateInt(1000), V8_PROPERTY_ATTRIBUTE_NONE);
@@ -174,3 +162,14 @@ bool CefV8HandlerImpl::Execute(const CefString& name //JavaScript calling funct
174162
}
175163
return true;
176164
}
165+
166+
167+
/**
168+
169+
170+
//std::string sql = "SELECT FROM users WHERE usernmae = '"+userName+"'";
171+
//std::string sql = "SELECT FROM users WHERE usernmae = 'aaa'";
172+
//{equipId:182, group:1, name:"louxiadaxingjiqiyihao", delay:100, period :1000 }
173+
//sqlite_exec_sql(sql);
174+
175+
*/

browser/SeasHandler.h

+9-2
Original file line numberDiff line numberDiff line change
@@ -516,9 +516,9 @@ class SeasResourceHandler : public CefResourceHandler {
516516
//const std::string& org_url_host = CefString(&parts.host);
517517

518518
const std::string& org_url_path = CefString(&parts.path);
519-
std::string url_path = org_url_path.substr(org_url_path.find("/", 2) + 1);
519+
std::string url_path = org_url_path; //org_url_path.substr(org_url_path.find("/", 2) + 1);
520520

521-
std::string url_host = org_url_path.substr(2, org_url_path.find("/", 2) - 2);
521+
std::string url_host = CefString(&parts.host);//org_url_path.substr(2, org_url_path.find("/", 2) - 2);
522522

523523
if (strstr(url_host.c_str(), "global") != NULL) {
524524
request->SetURL(CefString("https://north.niimei.com"));
@@ -614,7 +614,14 @@ class SeasResourceHandler : public CefResourceHandler {
614614
CEF_REQUIRE_IO_THREAD();
615615

616616
DCHECK(!data_.empty() || isStreamed == true && totalLength > 0);
617+
618+
CefResponse::HeaderMap p;
619+
response->GetHeaderMap(p);
620+
/* if (p.find(CefString("Access-Control-Allow-Origin")).) {
617621
622+
}*/
623+
//p.insert(std::make_pair("Access-Control-Allow-Origin", "*"));
624+
response->SetHeaderMap(p);
618625
response->SetMimeType(mime_type_);
619626
response->SetStatus(200);
620627

btzero_10_flat/js/qr.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

btzero_10_flat/mobile.html

+2-11
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,10 @@
22
<html>
33
<head>
44
<meta charset="utf-8">
5-
<title>URL认证</title>
5+
<title>QEA 点击授权</title>
66
</head>
77

88
<body>
9-
this.urlloader = new egret.URLLoader();
10-
var urlreq:egret.URLRequest = new egret.URLRequest();
11-
urlreq.url = "http://httpbin.org/user-agent";
12-
this.urlloader.load( urlreq );
13-
this.urlloader.addEventListener(egret.Event.COMPLETE, this.onComplete, this);
14-
}
15-
private onComplete(event:egret.Event):void
16-
{
17-
console.log( this.urlloader.data );
18-
}
9+
点我即可授权
1910
</body>
2011
</html>

release_egret/index.html

-77
This file was deleted.

release_egret/libs/modules/egret/egret.min.js

-5
This file was deleted.

release_egret/libs/modules/egret/egret.web.min.js

-2
This file was deleted.

release_egret/libs/modules/eui/eui.min.js

-6
This file was deleted.

release_egret/libs/modules/res/res.min.js

-1
This file was deleted.

release_egret/libs/modules/tween/tween.min.js

-1
This file was deleted.

release_egret/main.min.js

-1
This file was deleted.
-5.17 KB
Binary file not shown.
-151 KB
Binary file not shown.
-5.08 KB
Binary file not shown.
Binary file not shown.
-9.54 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-86 KB
Binary file not shown.
-167 KB
Binary file not shown.
-77.6 KB
Binary file not shown.
-9.13 KB
Binary file not shown.
-15.1 KB
Binary file not shown.
Binary file not shown.
-8.96 KB
Binary file not shown.
Binary file not shown.
-18.9 KB
Binary file not shown.
-19.2 KB
Binary file not shown.
-19.1 KB
Binary file not shown.
-19.1 KB
Binary file not shown.
-11.5 KB
Binary file not shown.
-11.4 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
-4.55 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-1019 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-1.02 KB
Binary file not shown.
-938 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-933 Bytes
Binary file not shown.
-1.23 KB
Binary file not shown.
-933 Bytes
Binary file not shown.
-933 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.
-1.25 KB
Binary file not shown.

release_egret/resource/custom_skins/aboutUISkin.exml

-15
This file was deleted.

release_egret/resource/custom_skins/goodsListIRSkin.exml

-7
This file was deleted.

release_egret/resource/custom_skins/goodsUISkin.exml

-27
This file was deleted.

0 commit comments

Comments
 (0)