From 7015860f28663cc72e810715f2f6a16a7afb52fa Mon Sep 17 00:00:00 2001 From: huangzijian Date: Sat, 24 Oct 2020 10:37:32 +0800 Subject: [PATCH] =?UTF-8?q?feat(hobby-parent):=20=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E4=B8=80=E7=BA=A7=E5=88=86=E7=B1=BB=E5=8F=8A=E5=85=B6=E5=AF=B9?= =?UTF-8?q?=E5=BA=94=E7=9A=84=E4=BA=8C=E7=BA=A7=E5=88=86=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.js | 2 +- model/hobby-parent.js | 15 +++++++++++++++ pages/index/index.js | 11 ++++++++++- project.config.json | 2 +- 4 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 model/hobby-parent.js diff --git a/config.js b/config.js index a5527a144..50fe82e75 100644 --- a/config.js +++ b/config.js @@ -1,7 +1,7 @@ /* * @Author: Lamdaer * @Date: 2020-10-24 02:08:13 - * @LastEditTime: 2020-10-24 02:15:06 + * @LastEditTime: 2020-10-24 10:36:37 * @Description: * @FilePath: /opengauss/config.js */ diff --git a/model/hobby-parent.js b/model/hobby-parent.js new file mode 100644 index 000000000..8a19bd744 --- /dev/null +++ b/model/hobby-parent.js @@ -0,0 +1,15 @@ +/* + * @Author: Lamdaer + * @Date: 2020-10-24 02:56:28 + * @LastEditTime: 2020-10-24 03:27:02 + * @Description: + * @FilePath: /opengauss/model/hobby-parent.js + */ +import { HTTP } from '../utils/http' +export class HobbyParentModel extends HTTP { + getHobbyList() { + return this.request({ + url: '/gauss/hobby_parent/with_children', + }) + } +} diff --git a/pages/index/index.js b/pages/index/index.js index 1f5434c18..0d7123cec 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -1,13 +1,15 @@ /* * @Author: Lamdaer * @Date: 2020-10-24 01:58:20 - * @LastEditTime: 2020-10-24 02:53:00 + * @LastEditTime: 2020-10-24 03:28:07 * @Description: * @FilePath: /opengauss/pages/index/index.js */ // pages/index/index.js import { JobModel } from '../../model/job' +import { HobbyParentModel } from '../../model/hobby-parent' const jobModel = new JobModel() +const hobbyParentModel = new HobbyParentModel() Page({ getJobList() { jobModel.getJobList().then((response) => { @@ -17,11 +19,17 @@ Page({ console.log(response) }) }, + getHobbyList() { + hobbyParentModel.getHobbyList().then((res) => { + console.log(res) + }) + }, /** * 页面的初始数据 */ data: { jobList: [], + hobbyParentList: [], }, /** @@ -29,6 +37,7 @@ Page({ */ onLoad: function (options) { this.getJobList() + this.getHobbyList() }, /** diff --git a/project.config.json b/project.config.json index 46046e19d..1ce2a08f8 100644 --- a/project.config.json +++ b/project.config.json @@ -4,7 +4,7 @@ "ignore": [] }, "setting": { - "urlCheck": true, + "urlCheck": false, "es6": true, "enhance": false, "postcss": true,