/*
* @Description: 装饰器
*/
function init(){
const res = await AxiosFun.post(`/dictionary`)
}
export function Dict(arr) {
return function (target, key,descriptor) {
const oldValue = descriptor.value
descriptor.value = function () {
//AxiosFun为网络请求执行一系列装饰的方法
init().then(() => {
// 执行原方法
oldValue.apply(this, this.arguments);
});
}
return descriptor
}
}