目前我的上传图片的方法是分开写的 贴其中一个例子,如下代码:
现在 我要把這个upload 合并成一个方法,写在公共方法中,在controller中进行直接调用,
但是,现在的问题是每个url和data取的是当前service的接口地址 和当前参数 我怎么合并其代码,进行调用?
烦请大神告知下 谢谢~
人生最曼妙的风景,竟是内心的淡定与从容!
Just an idea, write a service, inject the upload plug-in dependency, and inside it is your $upload.upload method, which returns the formatted data. In other places, you only need to call this service and pass the current URL as a parameter
Just an idea, write a service, inject the upload plug-in dependency, and inside it is your $upload.upload method, which returns the formatted data.
In other places, you only need to call this service and pass the current URL as a parameter