我在一个类里写了一个异步方法```javascript
async login(user_name:string,password:string):Promise<boolean>{
try{
const res = await loginApi({ user_name, password })
this._token = res.access_token
this._id = res.user_info.user_id
uni.setStorageSync('token',this._token)
this.fetchUserInfo()
return true
}
catch(error:any){
console.log(error)
return false
}
}
loginApi是一个promise请求,运行到安卓手机上时报错```javascript
error: None of the following functions can be called with the arguments supplied:
16:45:43.649 public suspend fun <T> await(promise: UTSPromise<TypeVariable(T)>): TypeVariable(T) defined in io.dcloud.uts
16:45:43.649 public suspend fun <T> await(def: Deferred<TypeVariable(T)>): TypeVariable(T) defined in io.dcloud.uts
16:45:43.649 at store/userStore.uts:33:15
16:45:43.649 31 | async login(user_name:string,password:string):Promise<boolean>{
16:45:43.649 32 | try{
16:45:43.649 33 | const res = await loginApi({ user_name, password })
16:45:43.649 | ^
16:45:43.649 34 | this._token = res.access_token
16:45:43.649 35 | this._id = res.user_info.user_id
请问这个要怎么写
0 个回复