mirror of
https://github.com/certd/certd.git
synced 2026-04-25 13:17:25 +08:00
refactor: transfer
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import _ from 'lodash-es'
|
||||
export default {
|
||||
arrayToMap (array) {
|
||||
if (!array) {
|
||||
return {}
|
||||
}
|
||||
if (!_.isArray(array)) {
|
||||
return array
|
||||
}
|
||||
const map = {}
|
||||
for (const item of array) {
|
||||
if (item.key) {
|
||||
map[item.key] = item
|
||||
}
|
||||
}
|
||||
return map
|
||||
},
|
||||
mapToArray (map) {
|
||||
if (!map) {
|
||||
return []
|
||||
}
|
||||
if (_.isArray(map)) {
|
||||
return map
|
||||
}
|
||||
const array = []
|
||||
for (const key in map) {
|
||||
const item = map[key]
|
||||
item.key = key
|
||||
array.push(item)
|
||||
}
|
||||
return array
|
||||
}
|
||||
}
|
||||
@@ -190,7 +190,7 @@ import TaskForm from './components/task-form'
|
||||
import exportsApi from '../../api/api.exports'
|
||||
import _ from 'lodash-es'
|
||||
import DContainer from '../../components/d-container'
|
||||
|
||||
import commonUtil from '@/utils/util.common'
|
||||
function useDeploy (options) {
|
||||
const deployAdd = () => {
|
||||
options.deploy.push({
|
||||
@@ -248,6 +248,9 @@ export default {
|
||||
const route = useRoute()
|
||||
console.log('route', route)
|
||||
const optionParams = route.params.options ? JSON.parse(route.params.options) : {}
|
||||
if (optionParams.accessProviders) {
|
||||
optionParams.accessProviders = commonUtil.mapToArray(optionParams.accessProviders)
|
||||
}
|
||||
const optionsDefault = {
|
||||
cert: {
|
||||
csr: {
|
||||
|
||||
Reference in New Issue
Block a user