EntryController.cpp 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. //
  2. // Created by xcbosa on 2023/1/30.
  3. //
  4. #include "../processor/processor.h"
  5. #include "../webuiconf.h"
  6. #include "../processor/templates/framework7/Framework7Document.hpp"
  7. using namespace std;
  8. using namespace xc::processor;
  9. using namespace xc::processor::templates;
  10. using namespace xc::processor::templates::framework7;
  11. using namespace configor;
  12. namespace xc::controller {
  13. ResponseData *EntryController(RequestData request) {
  14. bool isLogin = false;
  15. return new TemplateResponseData({
  16. If(isLogin, {
  17. Framework7Document({
  18. p("登陆成功")
  19. }, {
  20. a("2023 © Frp-WebUI by XCBOSA")
  21. .classAdd("link")
  22. .onclick("window.open('https://github.com/XCBOSA/frp-webui-500k.git')")
  23. })
  24. }, {
  25. ContentGeneratorReference("LoginController", request)
  26. })
  27. });
  28. }
  29. ContentGeneratorDefineS(request.getURL() == "/" || request.getURL().length() == 0, EntryController(request))
  30. }