This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //封装uniapp的网络请求, 可以简单的通过$.get()或者$.post()发起请求, 而且可以自动传入token | |
| let ajax = function(opt) { | |
| opt = opt || {}; | |
| opt.method = opt.method.toUpperCase() || 'GET'; | |
| opt.url = opt.url || ''; | |
| opt.data = opt.data || {}; | |
| opt.success = opt.success || function() {}; | |
| opt.showLoading = opt.showLoading || false; | |
| //如果缓存中存在token, 则装入请求 |