Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
287948c4
提交
287948c4
authored
2月 20, 2022
作者:
taojinlong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: API 数据源
上级
d05ff66a
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
1 行增加
和
154 行删除
+1
-154
ShiroServiceImpl.java
.../java/io/dataease/auth/service/impl/ShiroServiceImpl.java
+1
-0
ApiAuthConfig.vue
frontend/src/views/system/datasource/ApiAuthConfig.vue
+0
-1
ApiVariable.vue
frontend/src/views/system/datasource/ApiVariable.vue
+0
-22
ImportJson.vue
frontend/src/views/system/datasource/ImportJson.vue
+0
-118
convert.js
frontend/src/views/system/datasource/convert.js
+0
-13
没有找到文件。
backend/src/main/java/io/dataease/auth/service/impl/ShiroServiceImpl.java
浏览文件 @
287948c4
...
@@ -20,6 +20,7 @@ public class ShiroServiceImpl implements ShiroService {
...
@@ -20,6 +20,7 @@ public class ShiroServiceImpl implements ShiroService {
// ----------------------------------------------------------
// ----------------------------------------------------------
// 放行Swagger2页面,需要放行这些
// 放行Swagger2页面,需要放行这些
filterChainDefinitionMap
.
put
(
"/api/data/demo"
,
ANON
);
filterChainDefinitionMap
.
put
(
"/doc.html**"
,
"doc"
);
filterChainDefinitionMap
.
put
(
"/doc.html**"
,
"doc"
);
filterChainDefinitionMap
.
put
(
"/deApi**"
,
ANON
);
filterChainDefinitionMap
.
put
(
"/deApi**"
,
ANON
);
filterChainDefinitionMap
.
put
(
"/swagger-ui.html"
,
ANON
);
filterChainDefinitionMap
.
put
(
"/swagger-ui.html"
,
ANON
);
...
...
frontend/src/views/system/datasource/ApiAuthConfig.vue
浏览文件 @
287948c4
...
@@ -59,7 +59,6 @@ export default {
...
@@ -59,7 +59,6 @@ export default {
data
()
{
data
()
{
return
{
return
{
options
:
[{
name
:
"No Auth"
},
{
name
:
"Basic Auth"
}],
options
:
[{
name
:
"No Auth"
},
{
name
:
"Basic Auth"
}],
encryptOptions
:
[{
id
:
false
,
name
:
this
.
$t
(
'commons.encrypted'
)}],
activeName
:
"verified"
,
activeName
:
"verified"
,
rule
:
{},
rule
:
{},
authConfig
:
{}
authConfig
:
{}
...
...
frontend/src/views/system/datasource/ApiVariable.vue
浏览文件 @
287948c4
...
@@ -36,32 +36,14 @@
...
@@ -36,32 +36,14 @@
highlight-first-item
highlight-first-item
@
select=
"change"
>
@
select=
"change"
>
</el-input>
</el-input>
<!-- <el-autocomplete-->
<!-- :disabled="isReadOnly"-->
<!-- size="small"-->
<!-- class="input-with-autocomplete"-->
<!-- v-model="item.value"-->
<!-- placeholder="valueText"-->
<!-- value-key="name"-->
<!-- highlight-first-item-->
<!-- @select="change">-->
<!-- </el-autocomplete>-->
</el-col>
</el-col>
<el-col
class=
"item"
>
<el-col
class=
"item"
>
<el-input
v-model=
"item.description"
size=
"small"
maxlength=
"200"
<el-input
v-model=
"item.description"
size=
"small"
maxlength=
"200"
:placeholder=
"$t('commons.description')"
show-word-limit
>
:placeholder=
"$t('commons.description')"
show-word-limit
>
</el-input>
</el-input>
<el-autocomplete
:disabled=
"isReadOnly"
v-if=
"suggestions"
v-model=
"item.name"
size=
"small"
<el-autocomplete
:disabled=
"isReadOnly"
v-if=
"suggestions"
v-model=
"item.name"
size=
"small"
:fetch-suggestions=
"querySearch"
@
change=
"change"
:placeholder=
"keyText"
show-word-limit
/>
:fetch-suggestions=
"querySearch"
@
change=
"change"
:placeholder=
"keyText"
show-word-limit
/>
</el-col>
<el-col
v-if=
"type === 'body'"
class=
"item kv-select"
>
<el-input
:disabled=
"isReadOnly"
v-model=
"item.contentType"
size=
"small"
@
change=
"change"
:placeholder=
"$t('api_test.request.content_type')"
show-word-limit
>
</el-input>
</el-col>
</el-col>
<el-col
class=
"item kv-delete"
>
<el-col
class=
"item kv-delete"
>
...
@@ -114,10 +96,6 @@ export default {
...
@@ -114,10 +96,6 @@ export default {
data
()
{
data
()
{
return
{
return
{
currentItem
:
null
,
currentItem
:
null
,
requireds
:
[
{
name
:
this
.
$t
(
'commons.selector.required'
),
id
:
true
},
{
name
:
this
.
$t
(
'commons.selector.not_required'
),
id
:
false
}
],
isSelectAll
:
true
,
isSelectAll
:
true
,
isActive
:
true
,
isActive
:
true
,
}
}
...
...
frontend/src/views/system/datasource/ImportJson.vue
deleted
100644 → 0
浏览文件 @
d05ff66a
<
template
>
<el-dialog
:title=
"$t('commons.import')"
:visible
.
sync=
"importVisible"
width=
"50%"
append-to-body
show-close
:close-on-click-modal=
"false"
@
closed=
"handleClose"
>
<el-tabs
v-model=
"activeName"
>
<el-tab-pane
label=
"JSON"
name=
"JSON"
>
<div
style=
"height: 400px"
>
<ms-code-edit
:mode=
"mode"
:data
.
sync=
"json"
theme=
"eclipse"
:modes=
"[]"
ref=
"codeEdit"
/>
</div>
</el-tab-pane>
<el-tab-pane
label=
"JSON-SCHEMA"
name=
"JSON-SCHEMA"
>
<div
style=
"height: 400px"
>
<ms-code-edit
:mode=
"mode"
:data
.
sync=
"jsonSchema"
theme=
"eclipse"
:modes=
"[]"
ref=
"codeEdit"
/>
</div>
</el-tab-pane>
</el-tabs>
<span
slot=
"footer"
class=
"dialog-footer"
>
<ms-dialog-footer
@
cancel=
"importVisible = false"
@
confirm=
"saveConfirm"
/>
</span>
</el-dialog>
</
template
>
<
script
>
import
DialogFooter
from
'./DialogFooter'
import
CodeEdit
from
"./CodeEdit"
;
import
json5
from
'json5'
;
const
Convert
=
require
(
'./convert.js'
);
const
MsConvert
=
new
Convert
();
export
default
{
name
:
"MsImportJson"
,
components
:
{
DialogFooter
,
CodeEdit
},
data
()
{
return
{
importVisible
:
false
,
activeName
:
"JSON"
,
mode
:
"json"
,
json
:
""
,
jsonSchema
:
""
,
};
},
watch
:
{},
props
:
{},
methods
:
{
openOneClickOperation
()
{
this
.
importVisible
=
true
;
},
checkIsJson
(
json
)
{
try
{
json5
.
parse
(
json
);
return
true
;
}
catch
(
e
)
{
return
false
;
}
},
checkIsJsonSchema
(
json
)
{
try
{
json
=
json5
.
parse
(
json
);
if
(
json
.
properties
&&
typeof
json
.
properties
===
'object'
&&
!
json
.
type
)
{
json
.
type
=
'object'
;
}
if
(
json
.
items
&&
typeof
json
.
items
===
'object'
&&
!
json
.
type
)
{
json
.
type
=
'array'
;
}
if
(
!
json
.
type
)
{
return
false
;
}
json
.
type
=
json
.
type
.
toLowerCase
();
let
types
=
[
'object'
,
'string'
,
'number'
,
'array'
,
'boolean'
,
'integer'
];
if
(
types
.
indexOf
(
json
.
type
)
===
-
1
)
{
return
false
;
}
return
JSON
.
stringify
(
json
);
}
catch
(
e
)
{
return
false
;
}
},
saveConfirm
()
{
if
(
this
.
activeName
===
'JSON'
)
{
if
(
!
this
.
checkIsJson
(
this
.
json
))
{
this
.
$error
(
this
.
$t
(
'schema.json_warning'
));
return
;
}
let
jsonData
=
MsConvert
.
format
(
json5
.
parse
(
this
.
json
));
//let jsonData = GenerateSchema(json5.parse(this.json));
this
.
$emit
(
'jsonData'
,
jsonData
);
}
else
{
if
(
!
this
.
checkIsJsonSchema
(
this
.
jsonSchema
))
{
this
.
$error
(
this
.
$t
(
'schema.json_schema_warning'
));
return
;
}
let
obj
=
json5
.
parse
(
this
.
jsonSchema
);
this
.
$emit
(
'jsonData'
,
obj
);
}
this
.
importVisible
=
false
;
},
handleClose
()
{
this
.
importVisible
=
false
;
},
}
}
</
script
>
<
style
scoped
>
</
style
>
frontend/src/views/system/datasource/convert.js
浏览文件 @
287948c4
...
@@ -189,18 +189,5 @@ class Convert {
...
@@ -189,18 +189,5 @@ class Convert {
return
objectTemplate
;
return
objectTemplate
;
}
}
/**
* 后台转换
* @param callback
*/
// schemaToJsonStr(schema, callback) {
// post('/api/definition/preview', schema, (response) => {
// if (callback) {
// callback(response.data);
// }
// });
// }
}
}
module
.
exports
=
Convert
;
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论