We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
typescript 中调用 Bomb.User.login() 时报错,出错代码:
Bomb.User.login()
const login = createAsyncThunk( 'login/login', async ({ userId, passwd }: { userId: string, passwd: string }) => { let res = await Bomb.User.login(userId,passwd) } )
报错:
类型在其自身的 "then" 方法的 fulfillment 回调中被直接或间接引用。
看声明文件中写的 export interface BmobPromise<T = any> extends Promise<BmobPromise<T>> {} 是 Promise 的子类,按理来说应该能用 async/await
export interface BmobPromise<T = any> extends Promise<BmobPromise<T>> {}
The text was updated successfully, but these errors were encountered:
这样使用 如下:
export const loginApi = async (params: API.LoginParams):Promise<BmobAPI.CurrentUser> => { clearStoragedData() try { const res = await new Promise((resolve,reject) => Bmob.User.login(params.username, params.password).then(resolve).catch(reject)); const result = res as BmobAPI.CurrentUser return result } catch (error:any) { if (error.code && error.code === 101) { throw new Error('用户名或密码错误') } throw error } }
Sorry, something went wrong.
No branches or pull requests
typescript 中调用
Bomb.User.login()
时报错,出错代码:报错:
看声明文件中写的
export interface BmobPromise<T = any> extends Promise<BmobPromise<T>> {}
是 Promise 的子类,按理来说应该能用 async/awaitThe text was updated successfully, but these errors were encountered: