UNPKG

@hhy5277/ns-cli

Version:

```shell # install it globally $ npm install -g ns-cli --registry http://199.10.9.178:8081/repository/npm-group/

41 lines (34 loc) 1.05 kB
// 通过 axios 获取结果 const axios = require('axios') axios.interceptors.response.use(res => { return res.data; }) /** * 获取模板列表 * @returns Promise * http://199.10.9.178:9090/api/v4/projects/36/repository/branches http://199.10.9.178:9090/api/v4/projects/36/repository/tags http://199.10.9.178:9090/api/v4/projects/ http://199.10.9.178:9090/api/v4/projects?search=juzhen_screen_web */ async function getRepoList() { //return axios.get('https://api.github.com/orgs/xxx/repos') // return axios.get('http://199.10.9.178:9090/api/v4/projects/36/repository/branches').map(e=>{ // return e.name // }) return [{name:'vue-template'},{name:'vue3.0-template'}]; } /** * 获取版本信息 * @param {string} repo 模板名称 * @returns Promise */ async function getTagList(repo) { //return axios.get(`https://api.github.com/repos/xxx/${repo}/tags`) //http://199.10.9.178:9090/api/v4/projects/36/repository/tags return [{name:'v1.0'},{name:'v2.0'}]; } module.exports = { getRepoList, getTagList }