Merge branch 'dev'

This commit is contained in:
奔跑的面条 2023-04-23 21:09:21 +08:00
commit 3a22339d6b
5 changed files with 539 additions and 534 deletions

View File

@ -21,7 +21,7 @@ axiosInstance.interceptors.request.use(
axiosInstance.interceptors.response.use( axiosInstance.interceptors.response.use(
(res: AxiosResponse) => { (res: AxiosResponse) => {
const { code } = res.data as { code: number } const { code } = res.data as { code: number }
if (code === undefined || code === null) return Promise.resolve(res) if (code === undefined || code === null) return Promise.resolve(res.data)
if (code === ResultEnum.DATA_SUCCESS) return Promise.resolve(res.data) if (code === ResultEnum.DATA_SUCCESS) return Promise.resolve(res.data)
// 重定向 // 重定向
if (ErrorPageNameMap.get(code)) redirectErrorPage(code) if (ErrorPageNameMap.get(code)) redirectErrorPage(code)

View File

@ -76,10 +76,11 @@ export const useChartDataFetch = (
if (res) { if (res) {
try { try {
const filter = targetComponent.filter const filter = targetComponent.filter
echartsUpdateHandle(newFunctionHandle(res?.data, res, filter)) const { data } = res
echartsUpdateHandle(newFunctionHandle(data, res, filter))
// 更新回调函数 // 更新回调函数
if (updateCallback) { if (updateCallback) {
updateCallback(newFunctionHandle(res?.data, res, filter)) updateCallback(newFunctionHandle(data, res, filter))
} }
} catch (error) { } catch (error) {
console.error(error) console.error(error)

View File

@ -130,8 +130,9 @@ const sendHandle = async () => {
const res = await customizeHttp(toRaw(targetData.value.request), toRaw(chartEditStore.getRequestGlobalConfig)) const res = await customizeHttp(toRaw(targetData.value.request), toRaw(chartEditStore.getRequestGlobalConfig))
loading.value = false loading.value = false
if (res) { if (res) {
if (!res?.data && !targetData.value.filter) window['$message'].warning('您的数据不符合默认格式,请配置过滤器!') const { data } = res
targetData.value.option.dataset = newFunctionHandle(res?.data, res, targetData.value.filter) if (!data && !targetData.value.filter) window['$message'].warning('您的数据不符合默认格式,请配置过滤器!')
targetData.value.option.dataset = newFunctionHandle(data, res, targetData.value.filter)
showMatching.value = true showMatching.value = true
return return
} }

View File

@ -59,6 +59,8 @@
<n-form-item path="username"> <n-form-item path="username">
<n-input <n-input
v-model:value="formInline.username" v-model:value="formInline.username"
type="text"
maxlength="16"
:placeholder="$t('global.form_account')" :placeholder="$t('global.form_account')"
> >
<template #prefix> <template #prefix>
@ -72,6 +74,7 @@
<n-input <n-input
v-model:value="formInline.password" v-model:value="formInline.password"
type="password" type="password"
maxlength="16"
show-password-on="click" show-password-on="click"
:placeholder="$t('global.form_password')" :placeholder="$t('global.form_password')"
> >