按钮级别的新版本,多级别的组织架构
loulijun2021
2023-08-09 76e49eb32372b05ecf3b3e4c63567c5a987430bd
src/utils/global.js
@@ -1,8 +1,3 @@
import { NewEncodingRules } from '@/api/systemSettings'
import { AppTicketSelect } from '@/api/basicInfo'
import axios from 'axios'
import Vue from 'vue'
// 全局主要颜色
export function getGlobalColor() {
  return { globalColor: `#42b983` }
@@ -62,14 +57,6 @@
  return `${hh}:${mm}`
}
// 获取规则生成的编码
export async function getNewEncodingRules(encode) {
  const res = await NewEncodingRules({ rightcode: encode })
  if (res.code === '200') {
    return { RightCode: res.data[0], numvalue: res.data[1] }
  }
}
// 递归清除数组每个元素下的children为空的数组
const clearAllChildren = (items, childrenName = 'children') => {
  for (let i = 0; i < items.length; i++) {
@@ -101,25 +88,4 @@
      callback()
    }
  }
}
// 获取token 用于请求畅捷通接口
export async function getTPlusToken() {
  const r1 = await AppTicketSelect()
  const r2 = r1.data[0]
  Vue.prototype.$AppKey = r2.appKey
  Vue.prototype.$AppSecret = r2.appSecret
  const data = {
    appTicket: r2.AppTicket,
    certificate: r2.certificate
  }
  const r3 = await axios.post(Vue.prototype.$chanjetBaseUrl + '/v1/common/auth/selfBuiltApp/generateToken',
    data, {
      headers: {
        'appKey': Vue.prototype.$AppKey,
        'appSecret': Vue.prototype.$AppSecret,
        'Content-Type': 'application/json'
      }
    })
  return r3.data.value.accessToken
}