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? 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 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 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 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 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? 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; 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? 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 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? 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. 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? 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 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? 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 Link to comment Share on other sites More sharing options...
picyka Posted October 5, 2021 Author Share Posted October 5, 2021 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 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... 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 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 Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now