mirror of
https://github.com/certd/certd.git
synced 2026-07-06 20:37:34 +08:00
refactor: fix
This commit is contained in:
@@ -1,7 +1,22 @@
|
||||
import { request } from './service'
|
||||
import _ from 'lodash-es'
|
||||
function arrayToMap (arr) {
|
||||
if (arr && arr instanceof Array) {
|
||||
const map = {}
|
||||
_.forEach(arr, item => {
|
||||
map[item.key] = item
|
||||
})
|
||||
return map
|
||||
}
|
||||
return arr
|
||||
}
|
||||
|
||||
function transfer (options) {
|
||||
options.accessProviders = arrayToMap(options.accessProviders)
|
||||
}
|
||||
export default {
|
||||
exportsToZip (options) {
|
||||
transfer(options)
|
||||
return request({
|
||||
url: '/exports/toZip',
|
||||
data: { options },
|
||||
|
||||
Reference in New Issue
Block a user