|
@@ -102,16 +102,16 @@ func OpenAction(w http.ResponseWriter, r *http.Request) {
|
|
|
if pagenum == 0 {
|
|
|
pagenum = 1
|
|
|
}
|
|
|
- res, err := mongodb.FindOneByField("user", &map[string]interface{}{
|
|
|
+ res, ok := mongodb.FindOneByField("user", &map[string]interface{}{
|
|
|
"appid": appid,
|
|
|
}, nil)
|
|
|
- if !err {
|
|
|
+ if !ok {
|
|
|
rCode = CODE_E5 //内部错误
|
|
|
rMsg = MSG_E5
|
|
|
}
|
|
|
if len(*res) > 0 && (*res)["status"] == 1 { //查看用户是否存在
|
|
|
- comip := GetAPIIP(r)
|
|
|
- if (*res)["userip"] == comip { //验证用户ip
|
|
|
+ userip := GetAPIIP(r)
|
|
|
+ if (*res)["userip"] == userip { //验证用户ip
|
|
|
APPID = appid
|
|
|
SECRET = util.ObjToString((*res)["secret"])
|
|
|
sign := GET(action, [][]string{
|