import Taro from "@tarojs/taro";

const KET = 'SELECT_DEP'

/** 部门 */
function set(data: number[]) {
  Taro.setStorageSync(KET, data)
}

function get(): number[] {
  const deps = Taro.getStorageSync(KET)
  if (deps && deps.length) {
    removeDeps()
    return deps
  }
  return []
}


function removeDeps() {
  Taro.removeStorageSync(KET)
}

function remove() {
  removeDeps()
}

export default {
  set,
  get,
  remove,
}
