Skip to content

Commit

Permalink
Encapsulating Https
Browse files Browse the repository at this point in the history
  • Loading branch information
Claimonx committed Mar 2, 2022
1 parent f774454 commit 546a6e7
Show file tree
Hide file tree
Showing 8 changed files with 165 additions and 49 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ yarn-error.log*
*.sln

package-lock.json
https.env.js
136 changes: 136 additions & 0 deletions config/api.env.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
import axios from "./http.env"
import { Token } from "./http.env"
/**
* 获取所有的License数据
* @param {String} url
* @param {Object} parms
* @returns
*/
export const getLicenseDataAll = (data = {}) => {
return axios.request({
url: "/data-license",
method: "get",
params: {
pageSize: data.pageSize,
pageNum: data.pageNum,
token: Token,
},
})
}

/**
* 获取所有的Dataset数据
* @param {String} url
* @param {Object} parms
* @returns
*/
export const getDatasetDataAll = (data) => {
return axios.request({
url: "/dataset",
method: "get",
params: data
})
}


/**
*
* @param {object} data
* @returns
*/
export const getDatasetBasic = (data) => {
return axios.request({
url: "/get_dataset_by_id",
method: "get",
params: data
})
}


/**
*
* @param {object} data
* @returns
*/
export const getLicenseBasicInfo = (data) => {
return axios.request({
url: "/get_license_basic_by_id",
method: "get",
params: data
})
}

/**
*
* @param {object} data
* @returns
*/
export const getLicenseBasicDataTab = (data) => {
return axios.request({
url: "/get_license_data_by_id",
method: "get",
params: data
})
}

/**
*
* @param {object} data
* @returns
*/
export const getLicenseBasicModleTab = (data) => {
return axios.request({
url: "/get_license_model_by_id",
method: "get",
params: data
})
}

/**
*
* @param {object} data
* @returns
*/
export const getLicenseBasicOtherTab = (data) => {
return axios.request({
url: "/get_license_other_by_id",
method: "get",
params: data
})
}

/**
*
* @param {object} data
* @returns
*/
export const getLoadLicenseAll = (data) => {
return axios.request({
url: "/data-license",
method: "get",
params: {
data: data,
token: Token

}
})
}


/**
* 获取所有的Dataset数据
* @param {String} url
* @param {Object} parms
* @returns
*/
export const getLoadDatasetAll = (data) => {
return axios.request({
url: "/dataset",
method: "get",
params: {
data: data,
token: '2f6b61b197c846f2c3da8efea0b37b6d3353d7fbc8acaca0ff9f03d3980794ec',

}
})
}
23 changes: 6 additions & 17 deletions src/components/Search/searchDataset.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@

<script>
import axios from "axios";
import {getLoadDatasetAll} from '../../../config/api.env'
export default {
data() {
return {
Expand Down Expand Up @@ -54,23 +56,10 @@ export default {
);
};
},
loadAll() {
// 请求所有的 liense
//要求提供模糊查询的接口
//{id name}
let that = this;
axios
.get("http://10.233.58.26:9000/api/v1/dataset", {
params: {
pageNum: 1,
pageSize: 20,
// status: this.numLicenseData.status,
// totalNum: this.numLicenseData.totalNum,
},
})
.then(function (response) {
that.restaurants = response.data.data;
});
async loadAll() {
const {data} = await getLoadDatasetAll();
this.restaurants = data;
console.log(this.restaurants);
},
handleSelect(item) {
this.$router.push({
Expand Down
27 changes: 6 additions & 21 deletions src/components/Search/searchLicense.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</template>

<script>
import axios from "axios";
import {getLoadLicenseAll} from '../../../config/api.env'
export default {
data() {
return {
Expand Down Expand Up @@ -54,26 +54,11 @@ export default {
);
};
},
loadAll() {
// 请求所有的 liense
//要求提供模糊查询的接口
//{id name}
let that = this;
axios
.get("http://10.233.58.26:9000/api/v1/data-license", {
params: {
pageNum: 1,
pageSize: 20,
// status: this.numLicenseData.status,
// totalNum: this.numLicenseData.totalNum,
},
})
.then(function (response) {
that.restaurants = response.data.data;
// console.log(that.tableData);
// that.restaurants = response.data;
// console.log(that.numData);
});
async loadAll() {
const {data} = await getLoadLicenseAll();
this.restaurants = data;
console.log(this.restaurants);
},
fuzzyMatch(str, key) {
let index = -1,
Expand Down
7 changes: 3 additions & 4 deletions src/views/dataSetAll.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,8 @@
</div>
</template>
<script>
import axios from "axios";
import searchDataset from "../components/Search/searchDataset.vue";
import { getDatasetDataAll } from "../../config/http.env.js";
import { getDatasetDataAll } from "../../config/api.env.js";
export default {
components: { searchDataset },
Expand Down Expand Up @@ -146,10 +145,10 @@ export default {
});
},
async getDatasetData() {
const { data, totalNum } = await getDatasetDataAll(this.numLicenseData);
const { data, totalNum } = await getDatasetDataAll(this.numDatasetData);
this.dataSetData = data;
this.totalNum = totalNum;
console.log(this.numDatasetData);
},
// async getDatasetData() {
// // let that = this;
Expand Down
2 changes: 1 addition & 1 deletion src/views/dataSetInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ import axios from "axios";
import searchDataset from "../components/Search/searchDataset.vue";
import Export from "../components/Export/Export.vue";
import { getDatasetBasic } from "../../config/http.env.js";
import { getDatasetBasic } from "../../config/api.env.js";
export default {
components: { searchDataset, Export },
Expand Down
9 changes: 8 additions & 1 deletion src/views/licenseAll.vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
</template>
<script>
import searchLicense from "../components/Search/searchLicense.vue";
import { getLicenseDataAll } from "../../config/http.env.js";
import { getLicenseDataAll } from "../../config/api.env.js";
export default {
components: { searchLicense },
Expand Down Expand Up @@ -155,18 +155,25 @@ export default {
async getLicenseData() {
// let that = this;
const { data, totalNum } = await getLicenseDataAll(this.numLicenseData);
// const { data, totalNum } = await getLicenseDataAll();
this.licenseData = data;
console.log(this.licenseData);
this.totalNum = totalNum;
console.log(this.numLicenseData);
},
//分页监听 监听尺寸改变
handleSizeChange(newSize) {
this.numLicenseData.pageSize = newSize;
this.getLicenseData();
console.log(newSize);
},
//监听页码改变
handleCurrentChange(newPage) {
this.numLicenseData.pageNum = newPage;
this.getLicenseData();
console.log(newPage);
},
},
};
Expand Down
9 changes: 4 additions & 5 deletions src/views/licenseInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -236,13 +236,12 @@
</div>
</template>
<script>
import axios from "axios";
import searchLicense from "../components/Search/searchLicense.vue";
import Export from "../components/Export/Export.vue";
import { getLicenseBasicInfo } from "../../config/http.env.js";
import { getLicenseBasicDataTab } from "../../config/http.env.js";
import { getLicenseBasicModleTab } from "../../config/http.env.js";
import { getLicenseBasicOtherTab } from "../../config/http.env.js";
import { getLicenseBasicInfo } from "../../config/api.env.js";
import { getLicenseBasicDataTab } from "../../config/api.env.js";
import { getLicenseBasicModleTab } from "../../config/api.env.js";
import { getLicenseBasicOtherTab } from "../../config/api.env.js";
export default {
components: { searchLicense, Export },
Expand Down

0 comments on commit 546a6e7

Please sign in to comment.