hookehuyr

fix 报错提示修改

1 /* 1 /*
2 * @Date: 2022-05-18 22:56:08 2 * @Date: 2022-05-18 22:56:08
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2022-07-05 23:27:51 4 + * @LastEditTime: 2022-11-21 17:12:28
5 - * @FilePath: /tswj/src/api/fn.js 5 + * @FilePath: /data-table/src/api/fn.js
6 * @Description: 文件描述 6 * @Description: 文件描述
7 */ 7 */
8 import axios from '@/utils/axios'; 8 import axios from '@/utils/axios';
9 -import { Toast } from 'vant';
10 import qs from 'Qs' 9 import qs from 'Qs'
10 +import { showSuccessToast, showFailToast } from 'vant';
11 11
12 /** 12 /**
13 * 网络请求功能函数 13 * 网络请求功能函数
...@@ -21,12 +21,8 @@ export const fn = (api) => { ...@@ -21,12 +21,8 @@ export const fn = (api) => {
21 return res.data || true; 21 return res.data || true;
22 } else { 22 } else {
23 // tslint:disable-next-line: no-console 23 // tslint:disable-next-line: no-console
24 - console.warn(res); 24 + // if (!res.data.show) return false;
25 - if (!res.data.show) return false; 25 + showFailToast(res.data.msg);
26 - Toast({
27 - icon: 'close',
28 - message: res.data.msg
29 - });
30 return false; 26 return false;
31 } 27 }
32 }) 28 })
......