Heim  >  Fragen und Antworten  >  Hauptteil

javascript - 单页应用的php后端如何设置?

前端:
vue + vue-router(html5 history api) + vue-cli

后端:
yii2

我刚开始的时候是将build出来的东西(index.html和static)那些当成静态资源来访问。但是这样子的话我就没有办法在访问index.html的时候生成cookie了(例如csrf的token之类的)。 那这样子的话我应该采用什么策略,保证用户在访问这个页面的时候能够在后端生成cookie并返回?

ringa_leeringa_lee2721 Tage vor227

Antworte allen(1)Ich werde antworten

  • 天蓬老师

    天蓬老师2017-04-11 12:34:08

    json web token

    Antwort
    0
  • StornierenAntwort