|
|
|
|
@ -19,7 +19,8 @@ const formatTime = date => {
|
|
|
|
|
|
|
|
|
|
// 其他更多是格式化有如下:
|
|
|
|
|
// yyyy:mm:dd|yyyy:mm|yyyy年mm月dd日|yyyy年mm月dd日 hh时MM分等,可自定义组合
|
|
|
|
|
function timeFormat(dateTime = null, fmt = 'yyyy-mm-dd') {try {
|
|
|
|
|
function timeFormat(dateTime = null, fmt = 'yyyy-mm-dd') {
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
// 如果为null,则格式化当前时间
|
|
|
|
|
if (!dateTime) dateTime = Number(new Date());
|
|
|
|
|
@ -135,6 +136,7 @@ const request = options => {
|
|
|
|
|
uni.request({
|
|
|
|
|
...options,
|
|
|
|
|
success: function(res) {
|
|
|
|
|
uni.hideLoading();
|
|
|
|
|
if (res.statusCode != 200) {
|
|
|
|
|
if (options.utilFail != undefined) {
|
|
|
|
|
if (res.statusCode == 401) {
|
|
|
|
|
@ -160,11 +162,14 @@ const request = options => {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
fail: options.utilFail,
|
|
|
|
|
fail: function(res) {
|
|
|
|
|
uni.hideLoading();
|
|
|
|
|
options.utilFail(res);
|
|
|
|
|
},
|
|
|
|
|
complete: function(res) {
|
|
|
|
|
if (!options.customLoading) {
|
|
|
|
|
uni.hideNavigationBarLoading();
|
|
|
|
|
uni.hideLoading();
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
// 当前页面请求数量-1
|
|
|
|
|
if (options.bindThis) {
|
|
|
|
|
|