export function checkAuth() { return function ( _target: Record, _propertyName: string, descriptor: TypedPropertyDescriptor<(...args: any[]) => any>, ) { // 劫持目标方法 const method = descriptor.value; // 重写目标方法 // eslint-disable-next-line no-param-reassign descriptor.value = function (...args: any[]) { // 登录完成之后,重放原来方法 if (method) return method.apply(this, args); }; }; }