Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
basic-vue-admin
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-vue-admin
Commits
59028867
Unverified
提交
59028867
authored
10月 12, 2021
作者:
miofly
提交者:
GitHub
10月 12, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(type): 修复几个 ts 报错,和文件引用位置 (#1283)
* fix(type): 删除多余的类型定义 * fix(login): 删除登录时的 toRaw 包裹参数 * fix(type): 修复几个 ts 报错,和文件引用位置
上级
7a1b6e74
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
11 行增加
和
13 行删除
+11
-13
constant.ts
src/router/constant.ts
+1
-1
Axios.ts
src/utils/http/axios/Axios.ts
+1
-1
index.ts
src/utils/http/axios/index.ts
+2
-2
LoginForm.vue
src/views/sys/login/LoginForm.vue
+7
-9
没有找到文件。
src/router/constant.ts
浏览文件 @
59028867
...
@@ -4,7 +4,7 @@ export const PARENT_LAYOUT_NAME = 'ParentLayout';
...
@@ -4,7 +4,7 @@ export const PARENT_LAYOUT_NAME = 'ParentLayout';
export
const
PAGE_NOT_FOUND_NAME
=
'PageNotFound'
;
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
* @description: default layout
...
...
src/utils/http/axios/Axios.ts
浏览文件 @
59028867
import
type
{
AxiosRequestConfig
,
AxiosInstance
,
AxiosResponse
,
AxiosError
}
from
'axios'
;
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
type
{
CreateAxiosOptions
}
from
'./axiosTransform'
;
import
axios
from
'axios'
;
import
axios
from
'axios'
;
import
qs
from
'qs'
;
import
qs
from
'qs'
;
...
...
src/utils/http/axios/index.ts
浏览文件 @
59028867
...
@@ -140,7 +140,7 @@ const transform: AxiosTransform = {
...
@@ -140,7 +140,7 @@ const transform: AxiosTransform = {
const
token
=
getToken
();
const
token
=
getToken
();
if
(
token
&&
(
config
as
Recordable
)?.
requestOptions
?.
withToken
!==
false
)
{
if
(
token
&&
(
config
as
Recordable
)?.
requestOptions
?.
withToken
!==
false
)
{
// jwt token
// jwt token
config
.
headers
.
Authorization
=
options
.
authenticationScheme
(
config
as
Recordable
)
.
headers
.
Authorization
=
options
.
authenticationScheme
?
`
${
options
.
authenticationScheme
}
${
token
}
`
?
`
${
options
.
authenticationScheme
}
${
token
}
`
:
token
;
:
token
;
}
}
...
@@ -184,7 +184,7 @@ const transform: AxiosTransform = {
...
@@ -184,7 +184,7 @@ const transform: AxiosTransform = {
return
Promise
.
reject
(
error
);
return
Promise
.
reject
(
error
);
}
}
}
catch
(
error
)
{
}
catch
(
error
)
{
throw
new
Error
(
error
);
throw
new
Error
(
error
as
unknown
as
string
);
}
}
checkStatus
(
error
?.
response
?.
status
,
msg
,
errorMessageMode
);
checkStatus
(
error
?.
response
?.
status
,
msg
,
errorMessageMode
);
...
...
src/views/sys/login/LoginForm.vue
浏览文件 @
59028867
...
@@ -82,7 +82,7 @@
...
@@ -82,7 +82,7 @@
</Form>
</Form>
</
template
>
</
template
>
<
script
lang=
"ts"
setup
>
<
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
{
Checkbox
,
Form
,
Input
,
Row
,
Col
,
Button
,
Divider
}
from
'ant-design-vue'
;
import
{
import
{
...
@@ -134,13 +134,11 @@
...
@@ -134,13 +134,11 @@
if
(
!
data
)
return
;
if
(
!
data
)
return
;
try
{
try
{
loading
.
value
=
true
;
loading
.
value
=
true
;
const
userInfo
=
await
userStore
.
login
(
const
userInfo
=
await
userStore
.
login
({
{
password
:
data
.
password
,
password
:
data
.
password
,
username
:
data
.
account
,
username
:
data
.
account
,
mode
:
'none'
,
//不要默认的错误提示
mode
:
'none'
,
//不要默认的错误提示
});
},
);
if
(
userInfo
)
{
if
(
userInfo
)
{
notification
.
success
({
notification
.
success
({
message
:
t
(
'sys.login.loginSuccessTitle'
),
message
:
t
(
'sys.login.loginSuccessTitle'
),
...
@@ -151,7 +149,7 @@
...
@@ -151,7 +149,7 @@
}
catch
(
error
)
{
}
catch
(
error
)
{
createErrorModal
({
createErrorModal
({
title
:
t
(
'sys.api.errorTip'
),
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
,
getContainer
:
()
=>
document
.
body
.
querySelector
(
`.
${
prefixCls
}
`
)
||
document
.
body
,
});
});
}
finally
{
}
finally
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论