dongxilan9351 2017-10-24 09:13
浏览 73
已采纳

将数据从一个页面(CMS)发送到子域(平台)

I hope, that you are able to help me, or at least give me a few suggestions for a solution.

Context: We have a grav CMS site containing general information, a blog etc (example.com). On a subdomain (test.example.com created in Ruby (backend) and Angular (frontend)) we have a fully developed two-sided platform.

The problem: I need to create a specific landingpage on example.com. This landingpage has to include a signup form, where i need to be able to read the entered data on a subdomain.

Ex: example.com/landing-page1 has a form which contains email, username and password. test.example.com is a fully developed platform, which has a sign-up flow. When submitting the form on example.com, it should open a new window with the test.example.com/sign-up, where the data from the form on example.com is read from.

As i see it, the best solution would be to create a cookie, which can be read from test.example.com. Is that possible?

To do this in grav, as i understand it, i need to create a plugin, that can create this cookie, and then i need to modify the platform so that it can read from the cookie. And i think i need to implement CORS as well to do this.

Any suggestions or help is greately appreciated.

  • 写回答

2条回答 默认 最新

  • duanguilin2007 2017-10-25 17:44
    关注

    I ended up with a different approach than above, so I could get out of creating a grav-plugin. I made the form on example.com send a GET-request to the subdomain, and through that passing the variables through the URL. Then i created a service to store this data, which i then injected in the angular modules, where i needed to access the data.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 linux驱动,linux应用,多线程
  • ¥20 我要一个分身加定位两个功能的安卓app
  • ¥15 基于FOC驱动器,如何实现卡丁车下坡无阻力的遛坡的效果
  • ¥15 IAR程序莫名变量多重定义
  • ¥15 (标签-UDP|关键词-client)
  • ¥15 关于库卡officelite无法与虚拟机通讯的问题
  • ¥15 目标检测项目无法读取视频
  • ¥15 GEO datasets中基因芯片数据仅仅提供了normalized signal如何进行差异分析
  • ¥100 求采集电商背景音乐的方法
  • ¥15 数学建模竞赛求指导帮助