发表于: 2017-07-24 22:37:47

1 698


今天完成的事情:调接口,修复修真院bug

明天计划的事情:调接口,准备小课堂

遇到的问题:

一、后端的借口有些没通,给的假数据也有问题。和后端沟通后,解决了部分问题


二、对nginx有些不懂

后端的给的接口:/a/u/search/patient

ip和端口号:120.92.4.210:10808

现在有两种写法都能测通

1、

nginx的location:

location /a/{

                 proxy_pass   http://120.92.4.210:10808;

               proxy_set_header            Host                            $host;

                proxy_set_header            X-Real-IP                       $remote_addr;

                proxy_set_header            X-Forwarded-For                 $proxy_add_x_forwarded_for;

         }

接口:

//患者列表
patientList_url:function() {
 return "/a/u/search/patient"
}


2、nginx的location:

location /a/{

                 proxy_pass   http://120.92.4.210:10808/;

               proxy_set_header            Host                            $host;

                proxy_set_header            X-Real-IP                       $remote_addr;

                proxy_set_header            X-Forwarded-For                 $proxy_add_x_forwarded_for;

         }


//患者列表
patientList_url:function() {
 return "/a/a/u/search/patient"
}

这两者的区别在于拦截名后面的斜杠,对于接口的影响:没有斜杠,少写一个a


收获:

了解了百度统计,使用起来很简单,不过一些功能要付费





返回列表 返回列表
评论

    分享到