ui: 笼统的错误提示
This commit is contained in:
@@ -86,7 +86,10 @@ interface SnackbarOptions extends Options {
|
||||
export function checkApiSuccessOrSncakbar(re: ApiCallbackMessage, msg_ahead: string, opinions_override: Options = {}): Snackbar | null {
|
||||
return re.code != 200 ? snackbar(
|
||||
Object.assign({
|
||||
message: `${msg_ahead}: ${re.msg} [${re.code}]`,
|
||||
message: `${msg_ahead}: ${re.msg.indexOf("Failed to fetch") != -1
|
||||
? "HTTP 请求失败"
|
||||
: re.msg
|
||||
} [${re.code}]`,
|
||||
placement: "top",
|
||||
} as SnackbarOptions, opinions_override)
|
||||
) : null
|
||||
|
||||
Reference in New Issue
Block a user