未验证 提交 59028867 编写于 作者: M miofly 提交者: GitHub

fix(type): 修复几个 ts 报错,和文件引用位置 (#1283)

* fix(type): 删除多余的类型定义

* fix(login): 删除登录时的 toRaw 包裹参数

* fix(type): 修复几个 ts 报错,和文件引用位置
上级 7a1b6e74
......@@ -4,7 +4,7 @@ export const PARENT_LAYOUT_NAME = 'ParentLayout';
export const PAGE_NOT_FOUND_NAME = 'PageNotFound';
export const EXCEPTION_COMPONENT = () => import('../views/sys/exception/Exception.vue');
export const EXCEPTION_COMPONENT = () => import('/@/views/sys/exception/Exception.vue');
/**
* @description: default layout
......
import type { AxiosRequestConfig, AxiosInstance, AxiosResponse, AxiosError } from 'axios';
import type { RequestOptions, Result, UploadFileParams } from '../../../../types/axios';
import type { RequestOptions, Result, UploadFileParams } from '/#/axios';
import type { CreateAxiosOptions } from './axiosTransform';
import axios from 'axios';
import qs from 'qs';
......
......@@ -140,7 +140,7 @@ const transform: AxiosTransform = {
const token = getToken();
if (token && (config as Recordable)?.requestOptions?.withToken !== false) {
// jwt token
config.headers.Authorization = options.authenticationScheme
(config as Recordable).headers.Authorization = options.authenticationScheme
? `${options.authenticationScheme} ${token}`
: token;
}
......@@ -184,7 +184,7 @@ const transform: AxiosTransform = {
return Promise.reject(error);
}
} catch (error) {
throw new Error(error);
throw new Error(error as unknown as string);
}
checkStatus(error?.response?.status, msg, errorMessageMode);
......
......@@ -82,7 +82,7 @@
</Form>
</template>
<script lang="ts" setup>
import { reactive, ref, toRaw, unref, computed } from 'vue';
import { reactive, ref, unref, computed } from 'vue';
import { Checkbox, Form, Input, Row, Col, Button, Divider } from 'ant-design-vue';
import {
......@@ -134,13 +134,11 @@
if (!data) return;
try {
loading.value = true;
const userInfo = await userStore.login(
{
password: data.password,
username: data.account,
mode: 'none', //不要默认的错误提示
},
);
const userInfo = await userStore.login({
password: data.password,
username: data.account,
mode: 'none', //不要默认的错误提示
});
if (userInfo) {
notification.success({
message: t('sys.login.loginSuccessTitle'),
......@@ -151,7 +149,7 @@
} catch (error) {
createErrorModal({
title: t('sys.api.errorTip'),
content: error.message || t('sys.api.networkExceptionMsg'),
content: (error as unknown as Error).message || t('sys.api.networkExceptionMsg'),
getContainer: () => document.body.querySelector(`.${prefixCls}`) || document.body,
});
} finally {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册