Browse Source

增加版本号校验

liyuan 1 month ago
parent
commit
0a977a7df1
2 changed files with 5 additions and 5 deletions
  1. 2 2
      http/api.js
  2. 3 3
      pages/home/insurance/details.vue

+ 2 - 2
http/api.js

@@ -81,7 +81,7 @@ http.interceptors.response.use((response) => {
 		return response.data
 	}
 	// 服务端返回的状态码不等于200,则reject()
-	if (response.data.code !== 200) {
+	if (response.data.code !== 200 && response.data.code !== 601) {
 		console.log(response.data.code)
 
 		if (response.data.code === 400) {
@@ -166,4 +166,4 @@ http.interceptors.response.use((response) => {
 	}
 	return Promise.reject(response.data)
 })
-export default http;
+export default http;

+ 3 - 3
pages/home/insurance/details.vue

@@ -789,13 +789,13 @@
 							submitApproval(_this.form).then(res => {
 									setTimeout(() => {
 										uni.showToast({
-											title: '操作成功',
+											title: res.msg,
 											icon: 'none',
 											duration: 2000
 										});
 									}, 10);
 									uni.setStorageSync('isUpdate', true)
-									_this.getDetail(res.data.id)
+									_this.getDetail(res.code === 601 ? _this.form.id : res.data.id)
 								})
 								.catch(() => {
 									uni.hideLoading()
@@ -1024,4 +1024,4 @@
 		pointer-events: none !important;
 		touch-action: none !important;
 	}
-</style>
+</style>