Browse Source

增加版本号校验

liyuan 1 day ago
parent
commit
cec6bd66a7
2 changed files with 4 additions and 4 deletions
  1. 2 2
      http/api.js
  2. 2 2
      pages/home/insurance/details.vue

+ 2 - 2
http/api.js

@@ -79,7 +79,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) {
@@ -164,4 +164,4 @@ http.interceptors.response.use((response) => {
 	}
 	return Promise.reject(response.data)
 })
-export default http;
+export default http;

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

@@ -803,12 +803,12 @@
 				submit(obj).then(res => {
 						setTimeout(() => {
 							uni.showToast({
-								title: '保存成功',
+								title: res.msg,
 								icon: 'none',
 							});
 						}, 10);
 						uni.setStorageSync('isUpdate', true)
-						this.getDetail(res.data.id)
+            this.getDetail(res.code === 601 ? this.form.id : res.data.id)
 					})
 					.catch(() => {
 						uni.hideLoading()