picyka Posted October 5, 2021 Share Posted October 5, 2021 Currently the title of the application is in the server module, that is, only one per application, would it be possible to change this per session? Quote Link to comment Share on other sites More sharing options...
JhonSina Posted October 5, 2021 Share Posted October 5, 2021 Existe essa opção no mainmodule, creio que talvez atenda. by Danillo 1 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 5, 2021 Share Posted October 5, 2021 8 minutes ago, picyka said: Currently the title of the application is in the server module, that is, only one per application, would it be possible to change this per session? Yes, you can use UnaMainModule.Title property. 1 Quote Link to comment Share on other sites More sharing options...
picyka Posted October 5, 2021 Author Share Posted October 5, 2021 I'll test it, I didn't know this one... thanks Quote Link to comment Share on other sites More sharing options...
picyka Posted October 5, 2021 Author Share Posted October 5, 2021 When I click on the login screen, it works fine, but if I use the event UniGUIMainModuleBeforeLogin he can't change Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 5, 2021 Share Posted October 5, 2021 3 minutes ago, picyka said: When I click on the login screen, it works fine, but if I use the event UniGUIMainModuleBeforeLogin he can't change Can you please explain in more details? Quote Link to comment Share on other sites More sharing options...
picyka Posted October 5, 2021 Author Share Posted October 5, 2021 13 minutes ago, Sherzod said: Can you please explain in more details? When I set the title on the login screen, after retrieving the user, it works fine, but there are users who have automatic login, passing a hash by the URL as a parameter, this case does not work procedure TUniMainModule.UniGUIMainModuleBeforeLogin(Sender: TObject; var Handled: Boolean); var aApp: TUniGUIApplication; lCliente: String; begin Handled := False; aApp := (Sender as TUniGUISession).UniApplication; lCliente := aApp.Parameters.Values['u']; if not lCliente.IsEmpty then begin var lClientAuth := Self.ClientApiAuth; try try Self.TOKEN_API := lClientAuth.Service<IServiceLogin>.ValidaLoginHash(UpperCase(lCliente)); Handled := (Self.TOKEN_API <> ''); if Handled then begin UniMainModule.SetUserLogado(Self.GetClientApiApp.Service<IServiceUsuario>.FindUsuarioByHash(UpperCase(lCliente))); if Self.UserActive.Empresa <> nil then Self.Title := 'Assistência 24 HS - ' + UniMainModule.UserActive.Empresa.NomeFantasia; UniSession.UserString := UniMainModule.UserActive.Nome + ' - Mobile'; end; except Handled := False; end; finally lClientAuth.Free; end; end; end; Quote Link to comment Share on other sites More sharing options...
picyka Posted October 5, 2021 Author Share Posted October 5, 2021 1 hour ago, Sherzod said: Can you please explain in more details? Did you manage to simulate or error? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 5, 2021 Share Posted October 5, 2021 I will check a bit later, sorry. 1 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 5, 2021 Share Posted October 5, 2021 3 hours ago, picyka said: if Self.UserActive.Empresa <> nil then Self.Title := 'Assistência 24 HS - ' + UniMainModule.UserActive.Empresa.NomeFantasia; You want to say that this code doesn't work? Quote Link to comment Share on other sites More sharing options...
picyka Posted October 5, 2021 Author Share Posted October 5, 2021 38 minutes ago, Sherzod said: Quer dizer que esse código não funciona? yes. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 5, 2021 Share Posted October 5, 2021 1 hour ago, picyka said: yes. Are you sure that the condition is true? Quote Link to comment Share on other sites More sharing options...
picyka Posted October 5, 2021 Author Share Posted October 5, 2021 1 minuto atrás, Sherzod disse: Tem certeza que a condição é verdadeira? Yes, I ran in debug Quote Link to comment Share on other sites More sharing options...
picyka Posted October 5, 2021 Author Share Posted October 5, 2021 5 minutes ago, Sherzod said: Are you sure that the condition is true? n this case, it opens a form of the mobile, is that why? Quote Link to comment Share on other sites More sharing options...
picyka Posted October 5, 2021 Author Share Posted October 5, 2021 http://localhost:8077/m?u=a5c7a9c1a8bcb1b8b2c7b381b7c5c09479967b8a798b778a7a8b778a7b8b77%26a=78877D8B7B Quote Link to comment Share on other sites More sharing options...
picyka Posted October 5, 2021 Author Share Posted October 5, 2021 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 5, 2021 Share Posted October 5, 2021 2 minutes ago, picyka said: n this case, it opens a form of the mobile, is that why? I understand the general condition is true: 4 hours ago, picyka said: Handled := (Self.TOKEN_API <> ''); if Handled then But I'm not sure if this condition is true: 4 hours ago, picyka said: if Self.UserActive.Empresa <> nil then Quote Link to comment Share on other sites More sharing options...
picyka Posted October 5, 2021 Author Share Posted October 5, 2021 1 minuto atrás, Sherzod disse: Eu entendo que a condição geral é verdadeira: Mas não sei se essa condição é verdadeira: Look at the attached images, I debugged it here, the condition is true, if you want you can access it here... Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 5, 2021 Share Posted October 5, 2021 3 minutes ago, picyka said: if you want you can access it here... Okay Quote Link to comment Share on other sites More sharing options...
picyka Posted October 5, 2021 Author Share Posted October 5, 2021 24 minutes ago, Sherzod said: Okay Solution: UniSession.AddJS('document.title=" TESTE - ' + UniMainModule.UserActive.Empresa.NomeFantasia+'"'); 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.