diff --git a/pages/apply/complete.vue b/pages/apply/complete.vue index b082e49..079b801 100644 --- a/pages/apply/complete.vue +++ b/pages/apply/complete.vue @@ -46,10 +46,12 @@ onReady() {}, methods: { submit() { - // uni.navigateBack() - uni.reLaunch({ - url: '/pages/index/index' + uni.navigateBack({ + delta:2 }) + // uni.reLaunch({ + // url: '/pages/index/index' + // }) }, } diff --git a/pages/apply/index.vue b/pages/apply/index.vue index 57e4bed..92f8622 100644 --- a/pages/apply/index.vue +++ b/pages/apply/index.vue @@ -219,6 +219,14 @@ this.model2.userInfo.Sex = '0' } const json = this.model2.userInfo + // const json = { + // Name: '云', + // Sex: '0', + // Phone: '18480141719', + // ID_CARD: '230182200000000000', + // InTime: '2024-07-25', + // WORKINGYEAR: '0', + // } RegisterUser(json).then((res) => { if (res.code == 200) { console.log('成功', res); diff --git a/utils/request.js b/utils/request.js index 6605d81..d398131 100644 --- a/utils/request.js +++ b/utils/request.js @@ -20,7 +20,7 @@ export default (params) => { } else { tenantId = '0001' } - console.log(tenantId,'tenantId') + console.log(tenantId, 'tenantId') let url = params.url; let method = params.method || "get"; let data = params.data || {}; @@ -56,34 +56,34 @@ export default (params) => { uni.clearStorageSync() switch (res.statusCode) { case 401: - // uni.showModal({ - // title: "提示", - // content: "请登录", - // showCancel: false, - // success() { - // setTimeout(() => { - // uni.navigateTo({ - // url: "/pages/login/index", - // }) - // }, 1000); - // }, - // }); - uni.showToast({ - title: '请登录...', - duration: 2000, - }) + setTimeout(() => { + uni.showToast({ + icon: 'error', + title: '请稍后重试...', + duration: 3000, + }) + }, 10) + break; case 404: - uni.showToast({ - title: '请求地址不存在...', - duration: 2000, - }) + setTimeout(() => { + uni.showToast({ + icon: 'error', + title: '请求地址不存在...', + duration: 3000, + }) + }, 10) + break; default: - uni.showToast({ - title: '请重试...', - duration: 2000, - }) + setTimeout(() => { + uni.showToast({ + icon: 'error', + title: '服务器内部错误...', + duration: 3000, + }) + }, 10) + break; } } @@ -91,23 +91,29 @@ export default (params) => { fail(err) { console.log(err) if (err.errMsg.indexOf('request:fail') !== -1) { - uni.showToast({ - title: '网络异常', - icon: "error", - duration: 2000 - }) + setTimeout(() => { + uni.showToast({ + title: '网络异常', + icon: "error", + duration: 2000 + }) + }, 10) + } else { - uni.showToast({ - title: '未知异常', - duration: 2000 - }) + setTimeout(() => { + uni.showToast({ + title: '未知异常', + duration: 2000 + }) + }, 10) + } reject(err); }, complete() { // 不管成功还是失败都会执行 - uni.hideLoading(); + // uni.hideLoading(); uni.hideToast(); } });