请求网络接口失败时,会给出一个失败提示,需要在每个接口下面都写一遍吗,还是有没有办法写在一个共用的文件里,不用每个请求接口下面都引用,只要监测到请求接口失败,就自动调用
人生最曼妙的风景,竟是内心的淡定与从容!
Because the failure handling action for each request is different, the person who wrote the library cannot judge whether you want to perform the same failure handling. For the sake of generality, it should be written like this.
Just wrap a class to share it
Because the failure handling action for each request is different, the person who wrote the library cannot judge whether you want to perform the same failure handling. For the sake of generality, it should be written like this.
Just wrap a class to share it