17 lines
380 B
Go
17 lines
380 B
Go
package routers
|
|
|
|
import (
|
|
"main/models"
|
|
"main/utils"
|
|
"net/http"
|
|
)
|
|
|
|
// 獲取當前賬戶信息(重寫, 爲輸出增加sid字段)
|
|
func AccountGet(w http.ResponseWriter, r *http.Request) {
|
|
models.AccountRead(w, r, func(account *models.Account) {
|
|
account.ReadLikeList()
|
|
w.Header().Set("Content-Type", "application/json; charset=utf-8")
|
|
w.Write(utils.ToJSON(account))
|
|
})
|
|
}
|