diff --git a/usrc/service/app_core.cpp b/usrc/service/app_core.cpp index 624b7e9..c7bf30d 100644 --- a/usrc/service/app_core.cpp +++ b/usrc/service/app_core.cpp @@ -58,7 +58,7 @@ void AppCore::appsetup() { GStateMgr::ins()->initialize(); AppEventBus::ins()->initialize(); bool suc = ConfigService::ins()->initialize(); - if (true) { + if (!suc) { AppHardware::ins()->initialize(); // 基础硬件初始化 FrontEndControler::ins()->initialize(); // 前端控制器,对屏幕的消息进行解析,发送消息给屏幕 FrontEndControler::ins()->startSchedule(); diff --git a/usrc/service/page/Page_login.cpp b/usrc/service/page/Page_login.cpp index c759cde..be01eaa 100644 --- a/usrc/service/page/Page_login.cpp +++ b/usrc/service/page/Page_login.cpp @@ -21,12 +21,6 @@ static CfgItermCache cfgcache; bool Page_login::isBelongThisPage(int page) { return page == PAGE; } void Page_login::OnPageLoad() { - if (triggerLoginAction) { // triggerLoginAction为true说明用户刚刚输入完密码 - UIS->virtualClick(PAGE, OBJ(blogin), 0); // 触发一次登录按钮虚拟点击事件 - triggerLoginAction = false; - return; - } - static int enusrNum; static char usrName[6][20]; @@ -54,10 +48,23 @@ void Page_login::OnPageLoad() { UIS->setVal(PAGE, OBJ(chooseUsr), (int32_t)0); UIS->setVal(PAGE, OBJ(cUsrName), getCfgStr((config_index_t)(kusr_name0))); + + if (!UIS->isFromPopWin()) { + memset(txtPasswdCache, 0, sizeof(txtPasswdCache)); + } + + UIS->setVal(PAGE, OBJ(txtPasswd), txtPasswdCache); + + if (triggerLoginAction) { // triggerLoginAction为true说明用户刚刚输入完密码 + UIS->virtualClick(PAGE, OBJ(blogin), 0); // 触发一次登录按钮虚拟点击事件 + triggerLoginAction = false; + return; + } } void Page_login::OnInputFieldContentChange(uint8_t bid, const char* text) { // 输入框内容变化时,会触发一次页面重新加载的事件,这里的逻辑是为了实现,免按登录登录按键。 if (bid == OBJ(txtPasswd)) { + strncpy(txtPasswdCache, text, sizeof(txtPasswdCache)); triggerLoginAction = true; } } diff --git a/usrc/service/page/Page_login.hpp b/usrc/service/page/Page_login.hpp index 90aaf88..a1fb959 100644 --- a/usrc/service/page/Page_login.hpp +++ b/usrc/service/page/Page_login.hpp @@ -8,6 +8,7 @@ class Page_login : public IPageProcesser { /* data */ bool triggerLoginAction = false; + char txtPasswdCache[20] = {0}; public: static Page_login* ins() {