升级了部分依赖 安装了新的包
This commit is contained in:
@@ -6,7 +6,7 @@ import { message } from 'ant-design-vue';
|
||||
|
||||
// 泛型接口
|
||||
export interface Get {
|
||||
<T>(url: string, params?: object, config?: AxiosRequestConfig): Promise<CustomSuccessData<T>>;
|
||||
<T>(url: string, params?: unknown, config?: AxiosRequestConfig): Promise<CustomSuccessData<T>>;
|
||||
}
|
||||
|
||||
axios.interceptors.response.use((response)=>{
|
||||
@@ -17,12 +17,12 @@ axios.interceptors.response.use((response)=>{
|
||||
return Promise.reject(error)
|
||||
})
|
||||
|
||||
const get: Get = async function (url: string,data?: object) {
|
||||
const get: Get = async function (url: string,data?: unknown) {
|
||||
const res = await axios.get(url,{params:data});
|
||||
return res.data;
|
||||
}
|
||||
|
||||
const post: Get = async function (url: string,data?: object) {
|
||||
const post: Get = async function (url: string,data?: unknown) {
|
||||
const res = await axios.post(url,data)
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ export default defineComponent({
|
||||
/**
|
||||
* 验证直播时间
|
||||
*/
|
||||
async function validateDuration (rule: object, value: number): Promise<string | void> {
|
||||
async function validateDuration (rule: unknown, value: number): Promise<string | void> {
|
||||
if (value < 30 || value > 120) {
|
||||
return Promise.reject('*最短30min 最长120min');
|
||||
} else {
|
||||
@@ -121,7 +121,7 @@ export default defineComponent({
|
||||
/**
|
||||
* 验证直播人数
|
||||
*/
|
||||
const validateNumber = async (rule: object, value: number): Promise<string | void> => {
|
||||
const validateNumber = async (rule: unknown, value: number): Promise<string | void> => {
|
||||
if (value < 1 || value > 4) {
|
||||
return Promise.reject('**最少1人,最多4人');
|
||||
} else {
|
||||
@@ -169,7 +169,7 @@ export default defineComponent({
|
||||
e.preventDefault();
|
||||
validate().then(() => {
|
||||
console.log(toRaw(form));
|
||||
}).catch((err: object) => {
|
||||
}).catch((err: unknown) => {
|
||||
console.log('error', err);
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user