Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
T
topology-ui
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
姜立玮
topology-ui
Commits
50349fa8
提交
50349fa8
authored
4月 19, 2022
作者:
jianglw
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
添加token
上级
d17c16d7
变更
7
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
46 行增加
和
48 行删除
+46
-48
.env.development
.env.development
+1
-1
.env.production
.env.production
+1
-3
index.html
public/index.html
+1
-1
images.js
src/api/images.js
+3
-3
Images.vue
src/components/topology/modules/Images.vue
+2
-2
index.js
src/router/index.js
+1
-1
request.js
src/utils/request.js
+37
-37
没有找到文件。
.env.development
浏览文件 @
50349fa8
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
ENV = 'development'
ENV = 'development'
# 若依管理系统/开发环境
# 若依管理系统/开发环境
VUE_APP_BASE_API = '/'
VUE_APP_BASE_API = '/
dev-api
'
# 路由懒加载
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true
VUE_CLI_BABEL_TRANSPILE_MODULES = true
.env.production
浏览文件 @
50349fa8
...
@@ -2,9 +2,7 @@
...
@@ -2,9 +2,7 @@
ENV = 'production'
ENV = 'production'
# 若依管理系统/生产环境
# 若依管理系统/生产环境
VUE_APP_BASE_API = '
/
'
VUE_APP_BASE_API = ''
#端口
#端口
PORT = '8080'
PORT = '8080'
#{{ window._CONFIG['domianURL'] }}/jmreport/list?token=${token}
#layouts/IframePageView
public/index.html
浏览文件 @
50349fa8
...
@@ -281,7 +281,7 @@
...
@@ -281,7 +281,7 @@
params
.
setteeTag
=
setteeTag
;
params
.
setteeTag
=
setteeTag
;
axios
({
axios
({
method
:
'get'
,
method
:
'get'
,
url
:
'/params/show'
,
url
:
'/
topology/
params/show'
,
params
params
}).
then
(
res
=>
{
}).
then
(
res
=>
{
if
(
res
.
data
.
code
===
200
){
if
(
res
.
data
.
code
===
200
){
...
...
src/api/images.js
浏览文件 @
50349fa8
import
request
from
'@/utils/request'
import
request
from
'@/utils/request'
export
function
upload
(
data
)
{
export
function
upload
(
data
)
{
return
request
({
return
request
({
url
:
'/images/upload'
,
url
:
'/
topology/
images/upload'
,
method
:
'post'
,
method
:
'post'
,
data
:
data
data
:
data
})
})
}
}
export
function
deleteImages
(
id
)
{
export
function
deleteImages
(
id
)
{
return
request
({
return
request
({
url
:
'/images/delete/'
+
id
,
url
:
'/
topology/
images/delete/'
+
id
,
method
:
'delete'
method
:
'delete'
})
})
}
}
export
function
list
(){
export
function
list
(){
return
request
({
return
request
({
url
:
'/images/list'
,
url
:
'/
topology/
images/list'
,
method
:
'get'
method
:
'get'
})
})
}
}
\ No newline at end of file
src/components/topology/modules/Images.vue
浏览文件 @
50349fa8
...
@@ -55,12 +55,12 @@
...
@@ -55,12 +55,12 @@
@
click=
"selectImage(baseapi + item.url)"
@
click=
"selectImage(baseapi + item.url)"
>
选择图片
</el-button
>
选择图片
</el-button
>
>
<
a
-button
<
el
-button
type=
"text"
type=
"text"
class=
"button"
class=
"button"
style=
"color: red"
style=
"color: red"
@
click=
"deleteImage(item.id)"
@
click=
"deleteImage(item.id)"
>
删除
</
a
-button
>
删除
</
el
-button
>
>
</div>
</div>
</div>
</div>
...
...
src/router/index.js
浏览文件 @
50349fa8
...
@@ -10,7 +10,7 @@ VueRouter.prototype.push = function push(location) {
...
@@ -10,7 +10,7 @@ VueRouter.prototype.push = function push(location) {
}
}
const
routes
=
[
const
routes
=
[
{
{
path
:
'/
topologyView/list
'
,
path
:
'/'
,
name
:
'Index'
,
name
:
'Index'
,
component
:
()
=>
import
(
'@/views/configuration/ParamsConfig.vue'
)
component
:
()
=>
import
(
'@/views/configuration/ParamsConfig.vue'
)
},
},
...
...
src/utils/request.js
浏览文件 @
50349fa8
import
axios
from
'axios'
import
axios
from
'axios'
import
errorCode
from
'@/utils/errorCode'
import
errorCode
from
'@/utils/errorCode'
import
{
Notification
,
MessageBox
,
Message
}
from
'element-ui'
import
{
urlParse
}
from
'@/utils/ruoyi'
axios
.
defaults
.
headers
[
'Content-Type'
]
=
'application/json;charset=utf-8'
axios
.
defaults
.
headers
[
'Content-Type'
]
=
'application/json;charset=utf-8'
// 创建axios实例
// 创建axios实例
...
@@ -11,18 +13,17 @@ const service = axios.create({
...
@@ -11,18 +13,17 @@ const service = axios.create({
})
})
// request拦截器
// request拦截器
service
.
interceptors
.
request
.
use
(
config
=>
{
service
.
interceptors
.
request
.
use
(
config
=>
{
// // 是否需要设置 token
let
token
=
urlParse
();
// const isToken = (config.headers || {}).isToken === false
if
(
token
){
// if (getToken() && !isToken) {
config
.
headers
[
'X-Access-Token'
]
=
token
;
// config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
}
// }
// get请求映射params参数
// get请求映射params参数
if
(
config
.
method
===
'get'
&&
config
.
params
)
{
if
(
config
.
method
===
'get'
&&
config
.
params
)
{
let
url
=
config
.
url
+
'?'
;
let
url
=
config
.
url
+
'?'
;
for
(
const
propName
of
Object
.
keys
(
config
.
params
))
{
for
(
const
propName
of
Object
.
keys
(
config
.
params
))
{
const
value
=
config
.
params
[
propName
];
const
value
=
config
.
params
[
propName
];
var
part
=
encodeURIComponent
(
propName
)
+
"="
;
var
part
=
encodeURIComponent
(
propName
)
+
"="
;
if
(
value
!==
null
&&
typeof
(
value
)
!==
"undefined"
)
{
if
(
value
!==
null
&&
typeof
(
value
)
!==
"undefined"
)
{
if
(
typeof
value
===
'object'
)
{
if
(
typeof
value
===
'object'
)
{
for
(
const
key
of
Object
.
keys
(
value
))
{
for
(
const
key
of
Object
.
keys
(
value
))
{
let
params
=
propName
+
'['
+
key
+
']'
;
let
params
=
propName
+
'['
+
key
+
']'
;
...
@@ -40,42 +41,41 @@ service.interceptors.request.use(config => {
...
@@ -40,42 +41,41 @@ service.interceptors.request.use(config => {
}
}
return
config
return
config
},
error
=>
{
},
error
=>
{
console
.
log
(
error
)
Promise
.
reject
(
error
)
Promise
.
reject
(
error
)
})
})
// 响应拦截器
// 响应拦截器
service
.
interceptors
.
response
.
use
(
res
=>
{
service
.
interceptors
.
response
.
use
(
res
=>
{
// 未设置状态码则默认成功状态
// 未设置状态码则默认成功状态
const
code
=
res
.
data
.
code
||
200
;
const
code
=
res
.
data
.
code
||
200
;
// 获取错误信息
// 获取错误信息
const
msg
=
errorCode
[
code
]
||
res
.
data
.
msg
||
errorCode
[
'default'
]
const
msg
=
errorCode
[
code
]
||
res
.
data
.
msg
||
errorCode
[
'default'
]
if
(
code
===
401
)
{
if
(
code
===
401
)
{
// MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
MessageBox
.
confirm
(
'登录状态已过期,您可以继续留在该页面,或者重新登录'
,
'系统提示'
,
{
// confirmButtonText: '重新登录',
confirmButtonText
:
'重新登录'
,
// cancelButtonText: '取消',
cancelButtonText
:
'取消'
,
// type: 'warning'
type
:
'warning'
// }
// ).then(() => {
// store.dispatch('LogOut').then(() => {
// location.href = '/index';
// })
// })
}
else
if
(
code
===
500
)
{
// Message({
// message: msg,
// type: 'error'
// })
return
Promise
.
reject
(
new
Error
(
msg
))
}
else
if
(
code
!==
200
)
{
Notification
.
error
({
title
:
msg
})
return
Promise
.
reject
(
'error'
)
}
else
{
return
res
.
data
}
}
},
).
then
(()
=>
{
store
.
dispatch
(
'LogOut'
).
then
(()
=>
{
location
.
href
=
'/index'
;
})
})
}
else
if
(
code
===
500
)
{
Message
({
message
:
msg
,
type
:
'error'
})
return
Promise
.
reject
(
new
Error
(
msg
))
}
else
if
(
code
!==
200
)
{
Notification
.
error
({
title
:
msg
})
return
Promise
.
reject
(
'error'
)
}
else
{
return
res
.
data
}
},
error
=>
{
error
=>
{
console
.
log
(
'err'
+
error
)
console
.
log
(
'err'
+
error
)
let
{
message
}
=
error
;
let
{
message
}
=
error
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论