diff --git a/uniauth-backend/src/serviceinterface.cpp b/uniauth-backend/src/serviceinterface.cpp index 6969efb..1399dae 100644 --- a/uniauth-backend/src/serviceinterface.cpp +++ b/uniauth-backend/src/serviceinterface.cpp @@ -41,7 +41,7 @@ #include #define UKUI_GREETER "/usr/sbin/ukui-greeter" -#define UKUI_SCREENSAVER "/usr/bin/ukui-screensaver-dialog" +#define UKUI_SCREENSAVER "/usr/bin/ukui-screensaver-backend" #define GREETER_DBUS_PATH "/" #define GREETER_DBUS_INTERFACE "org.ukui.greeter" @@ -916,13 +916,13 @@ bool ServiceInterface::sendPassword(QString username,QByteArray password) rsac.decrypt(password, decryptText, priKey); // 解密 //如果处于登录状态 - qDebug()<<"sendPassword"<0){ + qDebug()<<"login by screensaver:"; + isFirstLogin = false; + QString publicKey = getLoginPubKey(loginAppList.value(loginAppList.firstKey()),SCREENSAVER_DBUS_PATH,SCREENSAVER_DBUS_INTERFACE); + rsac.encrypt(decryptText, encryptText, publicKey.toLatin1()); + return sendLoginPassword(loginAppList.value(loginAppList.firstKey()),SCREENSAVER_DBUS_PATH,SCREENSAVER_DBUS_INTERFACE,username,encryptText); + } + //如果是第一次调用,则配置自动登录 if(isFirstLogin){ qDebug()<<"isFirstLogin:"; @@ -965,13 +973,13 @@ bool ServiceInterface::handleFirstSingleLogn(QString username,QByteArray decrypt qDebug()< stateReply = iface.call("sendPassword",username,array); if(!stateReply.isValid()){ disconnect(connection);