close

睜大眼睛看清楚

你的data={

  client_id:2,
      client_secret:'lmXnxs7rV2oQXBmXOmUadeHomdM5UKhEr5LTQgzz',
        grant_type:'password',
        username:this.email,
        password:this.password

}

這是個grant 同意 ,所以要對到你的database的oauth_client資料表 Laravel Password Grant Client 

而不是Laravel Personal Access Client

data={

  client_id:2,  <----------------------------  must be   Laravel Password Grant Client     id
      client_secret:'lmXnxs7rV2oQXBmXOmUadeHomdM5UKhEr5LTQgzz',   <----------------------------  must be   Laravel Password Grant Client     id
        grant_type:'password',
        username:this.email,
        password:this.password

}

 

 

2.

 

resolve (2) go to AuthServiceProvider.php

keypoint:set expiration of token

Passport::tokensExpireIn(Carbon::now()->addDays(1));

You must to set token expiration cant be infinite

3.

檢查你的get的headers  有沒有token,沒有的話要加

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 學習程式 的頭像
    學習程式

    程式學習日記,如果我幫助了你請讓我知道

    學習程式 發表在 痞客邦 留言(0) 人氣()