修改报错提示
This commit is contained in:
@@ -45,6 +45,17 @@ http.interceptors.response.use((res) => {
|
|||||||
repeatNum: -4,
|
repeatNum: -4,
|
||||||
})
|
})
|
||||||
reject(data)
|
reject(data)
|
||||||
|
|
||||||
|
} else if (data.code === 502) {
|
||||||
|
ElMessage({
|
||||||
|
dangerouslyUseHTMLString: true,
|
||||||
|
message: data.message,
|
||||||
|
type: 'error',
|
||||||
|
plain: true,
|
||||||
|
grouping: true,
|
||||||
|
repeatNum: -4,
|
||||||
|
})
|
||||||
|
reject(data)
|
||||||
} else if (data.code !== 200) {
|
} else if (data.code !== 200) {
|
||||||
ElMessage({
|
ElMessage({
|
||||||
message: data.message,
|
message: data.message,
|
||||||
|
|||||||
@@ -14,15 +14,15 @@ app.onError((err, c) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (err.message === `Cannot read properties of undefined (reading 'get')`) {
|
if (err.message === `Cannot read properties of undefined (reading 'get')`) {
|
||||||
return c.json(result.fail('初始化失败:KV数据库未绑定或变量名错误'));
|
return c.json(result.fail('KV数据库未绑定<br>KV database not bound',502));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (err.message === `Cannot read properties of undefined (reading 'put')`) {
|
if (err.message === `Cannot read properties of undefined (reading 'put')`) {
|
||||||
return c.json(result.fail('初始化失败:KV数据库未绑定或变量名错误'));
|
return c.json(result.fail('KV数据库未绑定<br>KV database not bound',502));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (err.message === `Cannot read properties of undefined (reading 'prepare')`) {
|
if (err.message === `Cannot read properties of undefined (reading 'prepare')`) {
|
||||||
return c.json(result.fail('初始化失败:D1数据库未绑定或变量名错误'));
|
return c.json(result.fail('D1数据库未绑定<br>D1 database not bound',502));
|
||||||
}
|
}
|
||||||
|
|
||||||
return c.json(result.fail(err.message, err.code));
|
return c.json(result.fail(err.message, err.code));
|
||||||
|
|||||||
Reference in New Issue
Block a user