kaobei.opendata
kaobei.opendata copied to clipboard
使用者新增 TOKEN、使用 API TOKEN
使用者資料表新增 api_token(64) 新增 API TOKEN,以便後續 API 的介接
建議執行步驟:
- 瞭解 Laravel 的 資料庫遷移 這件事,並且嘗試讓
users
這張資料表新增api_token
這個欄位,欄位的屬性為 string(64) - 使用者在註冊會員時,要賦予使用者預設的 API TOKEN,所以要去了解一下
Repository
這件事,建議可以閱讀 這篇文章,或者 這篇文章 - 修改
UserRepository
,讓使用者在註冊會員時能擁有預設的 API TOKEN -
Repository
新增更新 API TOKEN 的方法 - 使用者前台修改資訊的地方,提供使用者更新 API TOKEN,但不是給使用者輸入,而是 str_random 亂數產生
- 後台使用者的部分,提供管理員更新使用者的 API TOKEN,並且提供管理者輸入,或是 str_random 亂數產生
看起來很可以,我這周末來看看