Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
开源群组
iotucy
Ivzone
Commits
5e7d5efb
Commit
5e7d5efb
authored
2 years ago
by
fjcydl
Browse files
Options
Download
Email Patches
Plain Diff
更新导入功能
parent
3ed978f4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
4 deletions
+13
-4
src/main.js
src/main.js
+2
-1
src/utils/request.js
src/utils/request.js
+7
-2
src/views/core/admin/index.vue
src/views/core/admin/index.vue
+4
-1
No files found.
src/main.js
View file @
5e7d5efb
...
...
@@ -2,7 +2,7 @@ import {createApp} from 'vue'
import
App
from
'
./App.vue
'
import
store
from
"
@/store
"
;
import
Router
from
'
./router
'
import
{
http
}
from
"
@/utils/request
"
import
{
http
,
urlConfig
}
from
"
@/utils/request
"
// import '@/doc' // 文档教程 不需要请注释掉
// import '@/api/mock' // 非数据模拟环境请注释
import
'
ant-design-vue/dist/antd.css
'
...
...
@@ -25,6 +25,7 @@ let app = createApp(App).use(Router).use(Antd).use(store)
app
.
config
.
globalProperties
.
ivzStx
=
''
app
.
config
.
globalProperties
.
ivzCtx
=
''
app
.
config
.
globalProperties
.
$http
=
http
app
.
config
.
globalProperties
.
$env
=
urlConfig
app
.
config
.
globalProperties
.
$msg
=
message
app
.
config
.
globalProperties
.
$notify
=
notification
...
...
This diff is collapsed.
Click to expand it.
src/utils/request.js
View file @
5e7d5efb
...
...
@@ -4,10 +4,15 @@ import router from '@/router'
import
CoreConsts
from
"
@/components/CoreConsts
"
;
// 当前环境
let
env
=
import
.
meta
.
env
.
DEV
?
'
dev
'
:
'
prod
'
;
function
UrlConfig
(
httpUrl
,
websocketUrl
)
{
function
UrlConfig
(
httpUrl
,
websocketUrl
,
apiUrl
)
{
this
.
httpUrl
=
httpUrl
;
this
.
apiUrl
=
apiUrl
||
httpUrl
;
this
.
websocketUrl
=
websocketUrl
;
this
.
getApiUrl
=
function
()
{
return
this
.
apiUrl
;
}
this
.
getBaseURI
=
function
()
{
return
this
.
httpUrl
;
}
...
...
@@ -26,7 +31,7 @@ function UrlConfig(httpUrl, websocketUrl) {
}
let
baseConfig
=
{
dev
:
new
UrlConfig
(
"
/api
"
,
'
ws://127.0.0.1:8087
'
),
dev
:
new
UrlConfig
(
"
/api
"
,
'
ws://127.0.0.1:8087
'
,
"
http://localhost:8085
"
),
prod
:
new
UrlConfig
(
"
http://iot.iteaj.com:8068/api
"
,
'
ws://iot.iteaj.com:8068
'
),
// 成功响应码
success
:
200
,
...
...
This diff is collapsed.
Click to expand it.
src/views/core/admin/index.vue
View file @
5e7d5efb
...
...
@@ -14,7 +14,7 @@
</URow>
<template
#func
>
<UFuncBtn
func=
"import"
url=
"/core/admin/import"
v-auth=
"'core:admin:import'"
:config=
"
{uploadConfig: {templateUrl:
'
/static/excel/
test
.xlsx
'
}}">导入
</UFuncBtn>
:config=
"
{uploadConfig: {templateUrl:
`${this.$env.apiUrl}
/static/excel/
用户导入模板
.xlsx
`
}}">导入
</UFuncBtn>
<UFuncBtn
func=
"export"
url=
"/core/admin/export"
v-auth=
"'core:admin:export'"
>
导出
</UFuncBtn>
</
template
>
</UViewSearch>
...
...
@@ -105,6 +105,9 @@ export default {
}
return
{
columns
,
rules
,
status
,
pwdRules
,
pwdModel
}
},
mounted
()
{
// this.$env.
}
}
</
script
>
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment