Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yongxinda-admin
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
刘旭
yongxinda-admin
Commits
1e8d7655
提交
1e8d7655
authored
12月 15, 2022
作者:
刘旭
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
优化导入lic
上级
c0fd1eb4
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
18 行增加
和
35 行删除
+18
-35
importLic.vue
src/views/login/importLic.vue
+16
-33
vite.config.ts
vite.config.ts
+2
-2
没有找到文件。
src/views/login/importLic.vue
浏览文件 @
1e8d7655
...
@@ -2,48 +2,31 @@
...
@@ -2,48 +2,31 @@
<el-alert
title=
"lic已失效,请通过mac地址,重新导入lic文件"
type=
"warning"
:closable=
'false'
center
/>
<el-alert
title=
"lic已失效,请通过mac地址,重新导入lic文件"
type=
"warning"
:closable=
'false'
center
/>
<div
class=
'app-container'
>
<div
class=
'app-container'
>
mac地址:
{{
macAddress
}}
mac地址:
{{
macAddress
}}
<el-button
type=
"primary"
style=
"width: 100px; margin-top: 20px;"
@
click=
"handleSelected"
>
导入lic文件
</el-button>
<el-upload
v-model:file-list=
"uploadData.fileList"
:action=
"uploadData.action"
accept=
".tmp"
<input
ref=
"uploadInput"
type=
"file"
style=
"display: none;"
accept=
".tmp"
@
change=
"submitUpload"
/>
:show-file-list=
"false"
style=
"width: 100px; margin-top: 20px;"
:on-success=
"handleSuccess"
>
<el-button
type=
"primary"
>
导入lic文件
</el-button>
</el-upload>
</div>
</div>
</
template
>
</
template
>
<
script
setup
lang=
'ts'
>
<
script
setup
lang=
'ts'
>
import
{
ref
}
from
'vue'
import
{
ref
,
reactive
}
from
'vue'
import
{
getMacAddress
,
importFile
}
from
'@/services/api/login/login'
import
{
getMacAddress
}
from
'@/services/api/login/login'
import
{
ElMessage
}
from
'element-plus'
import
{
ElMessage
}
from
'element-plus'
const
macAddress
=
ref
()
const
macAddress
=
ref
()
const
uploadInput
=
ref
()
const
uploadData
=
reactive
({
fileList
:
''
as
any
,
const
handleSelected
=
()
=>
uploadInput
.
value
.
click
()
action
:
'/admin/api/lic/info/file/import'
})
// //选好文件之后点击打开按钮
const
submitUpload
=
(
e
:
any
)
=>
{
const
files
=
e
.
target
.
files
const
rawFile
=
files
[
0
]
if
(
!
rawFile
)
return
upload
(
rawFile
)
}
//上传
const
upload
=
(
rawFile
:
any
)
=>
{
uploadInput
.
value
=
null
uploadSectionFile
(
rawFile
)
}
const
uploadSectionFile
=
(
file
:
any
,
params
?:
any
)
=>
{
let
fromData
=
new
FormData
()
// FormData 对象
let
fileObj
=
file
// 相当于input里取得的files
fromData
.
append
(
'file'
,
fileObj
)
// 文件对象
importFile
(
fromData
).
then
((
res
:
any
)
=>
{
const
handleSuccess
=
(
res
:
any
,
uploadFile
:
any
,
uploadFiles
:
any
)
=>
{
//调用上传接口
if
(
res
.
code
===
200
)
{
if
(
res
.
code
===
200
)
{
window
.
location
.
href
=
'/#/login'
window
.
location
.
href
=
'/#/login'
sessionStorage
.
clear
()
sessionStorage
.
clear
()
ElMessage
({
type
:
'success'
,
message
:
'导入成功!'
})
ElMessage
({
type
:
'success'
,
message
:
'导入成功!'
})
}
else
return
ElMessage
({
type
:
'error'
,
message
:
res
.
msg
})
}
})
}
}
getMacAddress
().
then
((
res
:
any
)
=>
{
getMacAddress
().
then
((
res
:
any
)
=>
{
...
...
vite.config.ts
浏览文件 @
1e8d7655
...
@@ -89,11 +89,11 @@ export default ({ command, mode }) => {
...
@@ -89,11 +89,11 @@ export default ({ command, mode }) => {
// '/foo': '',
// '/foo': '',
// 选项写法
// 选项写法
"/admin"
:
{
"/admin"
:
{
target
:
"http://192.168.0.
9:8089
/"
,
target
:
"http://192.168.0.
60:82
/"
,
// rewrite: (path) => path.replace(/^\/api/, '') http://192.168.0.9:8089/
// rewrite: (path) => path.replace(/^\/api/, '') http://192.168.0.9:8089/
},
},
"/wx"
:
{
"/wx"
:
{
target
:
"http://192.168.0.
9:8089
/"
,
target
:
"http://192.168.0.
60:82
/"
,
// rewrite: (path) => path.replace(/^\/api/, '')
// rewrite: (path) => path.replace(/^\/api/, '')
},
},
// 正则表达式写法
// 正则表达式写法
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论