Procházet zdrojové kódy

user info avatar url now protected with signature.

master
Patrick Peng Sun před 8 roky
rodič
revize
207d0825d1
3 změnil soubory, kde provedl 9 přidání a 6 odebrání
  1. +1
    -1
      crm_config.json
  2. +6
    -4
      crmcache.go
  3. +2
    -1
      procGetBasicUserInfo.go

+ 1
- 1
crm_config.json Zobrazit soubor

@@ -3,5 +3,5 @@
"UserName": "wechat",
"UserPass": "crmwechat.api",
"AttachmentCache" : "/tmp/",
"CacheSiteURL": "http://wechat.hitxy.org.au/crmcache"
"CacheSiteURL": "http://192.168.1.39:65500/crmcache"
}

+ 6
- 4
crmcache.go Zobrazit soubor

@@ -7,10 +7,12 @@ import (
)

func crmcache(w http.ResponseWriter, r *http.Request) {
// if !checkSignature(r) {
// w.WriteHeader(http.StatusUnauthorized)
// fmt.Fprintf(w, "Expired or invalid link")
// }
debugDumpHTTPRequest(r)
if !checkSignatureByToken(r, IntraAPIConfig.CRMSecrete) {
w.WriteHeader(http.StatusUnauthorized)
fmt.Fprintf(w, "Expired or invalid link")
return
}

v, err := url.ParseQuery(r.URL.RawQuery)
if err != nil {

+ 2
- 1
procGetBasicUserInfo.go Zobrazit soubor

@@ -61,7 +61,8 @@ func (m crmdLead) getBasicUserInfoPhoto() (ret sendNewsArticle) {
a.Description = ""
a.PicURL = m.avatarCacheURL()
a.Title = m.Name
a.URL = ""
a.URL = m.avatarCacheURL()
log.Println(a.URL)
return a
}


Načítá se…
Zrušit
Uložit