baidu / baidu/amis

api的适配器中,能不能调用某些函数,实现自定义错误提示

Open
#4,077 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
18.9k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

#### 是否关联于某个问题吗:
api能不能调用某些函数,因为产品希望在接口失败的情况下,可以toast方式提示用户某些内容。但是目前select的失败提示直接做到组件上面了,没法toast提示

#### 预期的解决方案:
api的适配器中,可以类似于actions,调用函数来实现特殊逻辑

#### 其他可接受方案:
api的msg可以toast方式展示

#### 任何附加信息:
![image](https://user-images.githubusercontent.com/16553854/163801184-0545e6ee-4bfd-4c02-b814-4e190db762b2.png)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the API adapter and the select component's failure handling, then compare how actions invoke custom functions. Done means the adapter supports the requested custom error logic or the API message can be configured to display as a toast instead of only on the component.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.