modify the comments
Showing
1 changed file
with
10 additions
and
7 deletions
| ... | @@ -13,6 +13,7 @@ | ... | @@ -13,6 +13,7 @@ |
| 13 | // limitations under the License. | 13 | // limitations under the License. |
| 14 | 14 | ||
| 15 | // Package apiauth provides handlers to enable apiauth support. | 15 | // Package apiauth provides handlers to enable apiauth support. |
| 16 | // | ||
| 16 | // Simple Usage: | 17 | // Simple Usage: |
| 17 | // import( | 18 | // import( |
| 18 | // "github.com/astaxie/beego" | 19 | // "github.com/astaxie/beego" |
| ... | @@ -29,24 +30,26 @@ | ... | @@ -29,24 +30,26 @@ |
| 29 | // | 30 | // |
| 30 | // func getAppSecret(appid string) string { | 31 | // func getAppSecret(appid string) string { |
| 31 | // // get appsecret by appid | 32 | // // get appsecret by appid |
| 32 | // // maybe store in configure, maybe in database | 33 | // // maybe store in configure, maybe in database |
| 33 | // } | 34 | // } |
| 34 | // | 35 | // |
| 35 | // beego.InsertFilter("*", beego.BeforeRouter,apiauth.APIAuthWithFunc(getAppSecret, 360)) | 36 | // beego.InsertFilter("*", beego.BeforeRouter,apiauth.APIAuthWithFunc(getAppSecret, 360)) |
| 36 | // | 37 | // |
| 37 | // in the request user should include these params in the query | 38 | // Infomation: |
| 39 | // | ||
| 40 | // In the request user should include these params in the query | ||
| 38 | // | 41 | // |
| 39 | // 1. appid | 42 | // 1. appid |
| 40 | // | 43 | // |
| 41 | // appid is asigned to the application | 44 | // appid is asigned to the application |
| 42 | // | 45 | // |
| 43 | // 2. signature | 46 | // 2. signature |
| 44 | // | 47 | // |
| 45 | // get the signature use apiauth.Signature() | 48 | // get the signature use apiauth.Signature() |
| 46 | // | 49 | // |
| 47 | // >>> should use url.QueryEscape() | 50 | // when you send to server remember use url.QueryEscape() |
| 48 | // | 51 | // |
| 49 | // 3. timestamp: | 52 | // 3. timestamp: |
| 50 | // | 53 | // |
| 51 | // send the request time, the format is yyyy-mm-dd HH:ii:ss | 54 | // send the request time, the format is yyyy-mm-dd HH:ii:ss |
| 52 | // | 55 | // | ... | ... |
-
Please register or sign in to post a comment