Closed wangming-0215 closed 3 years ago
class AuthService extends HttpClient { login(params: LoginParamsType) { console.log(this); return this.post('/api/login/account', { data: params }); } getCaptcha(mobile: string) { return this.get(`/api/login/captcha?mobile=${mobile}`); } } export const authService = new AuthService(); // auth.model.ts yield call(authService.login, payload)
effect 中调用yield call(authService, payload) 时,authService 中的 this 指向 null。
effect
yield call(authService, payload)
authService
this
null
effect
中调用yield call(authService, payload)
时,authService
中的this
指向null
。