How to use httpGET method in Puppeteer

Best JavaScript code snippet using puppeteer

index.js

Source:index.js Github

copy

Full Screen

1/**2 * 集中管理所有的 axios 请求3 * 一旦接口请求失败,则会再次发起请求,最多三次4 */5import { httpGet, httpPost } from '@/http/packageAxios';6/**7 * 用户 USER 相关8 * @Login 用户登录接口9 * @GetUserInfos 获取用户信息接口10 * @UpdateUserInfos 更新用户信息接口11 */12class USER {13 async Login (params = {}) {14 const res = await httpGet('/login', params);15 return res;16 }17 async GetUserInfos (params = {}) {18 const res = await httpGet('/getUserInfos', params);19 return res;20 }21 async UpdateUserInfo (data = {}) {22 const res = await httpPost('/updateUserInfo', data);23 return res;24 }25}26export const User = new USER();27/**28 * 导航菜单栏 MENULIST 相关接口29 */30class MENULIST {31 async GetMenuList (params = {}) {32 const res = await httpGet('/getMenuList', params);33 return res;34 }35}36export const menuList = new MENULIST();37/**38 * 笔记 Dashboard 相关接口39 * @GetDashboardList 查询 Dashboard 列表40 * @InsertDashboards 新增/更新 Dashboard 接口41 */42class DASHBOARD {43 async InsertDashboard (data = {}) {44 const res = await httpPost('/insertDashboardListItem', data);45 return res;46 }47 async GetDashboardList (params = {}) {48 const res = await httpGet('/getDashboardList', params);49 return res;50 }51 async DeleteDashboardList (params = {}) {52 const res = await httpGet('/deleteDashboardItem', params);53 return res;54 }55}56export const Dashboard = new DASHBOARD();57/**58 * 笔记 FS 相关接口59 * @GetFsList 查询 Fs 列表60 * @InsertFs 新增/更新 Fs 接口61 */62class FS {63 async InsertFs (data = {}) {64 const res = await httpPost('/insertFsListItem', data);65 return res;66 }67 async GetFsList (params = {}) {68 const res = await httpGet('/getFsList', params);69 return res;70 }71 async DeleteFsList (params = {}) {72 const res = await httpGet('/deleteFsItem', params);73 return res;74 }75}76export const Fs = new FS();77/**78 * 笔记 Es5 相关接口79 * @GetEs5List 查询 Es5 列表80 * @InsertEs5 新增/更新 Es5 接口81 * @DeleteEs5List 删除 Es5 接口82 */83class ES5 {84 async InsertEs5 (data = {}) {85 const res = await httpPost('/insertEs5ListItem', data);86 return res;87 }88 async GetEs5List (params = {}) {89 const res = await httpGet('/getEs5List', params);90 return res;91 }92 async DeleteEs5List (params = {}) {93 const res = await httpGet('/deleteEs5Item', params);94 return res;95 }96}97export const Es5 = new ES5();98/**99 * 笔记 Es6 相关接口100 * @GetEs6List 查询 Es6 列表101 * @InsertEs6 新增/更新 Es6 接口102 * @DeleteEs6List 删除 Es6 接口103 */104class ES6 {105 async InsertEs6 (data = {}) {106 const res = await httpPost('/insertEs6ListItem', data);107 return res;108 }109 async GetEs6List (params = {}) {110 const res = await httpGet('/getEs6List', params);111 return res;112 }113 async DeleteEs6List (params = {}) {114 const res = await httpGet('/deleteEs6Item', params);115 return res;116 }117}118export const Es6 = new ES6();119/**120 * 笔记 Vue 相关接口121 * @GetVueList 查询 Vue 列表122 * @InsertVue 新增/更新 Vue 接口123 * @DeleteVueList 删除 Vue 接口124 */125class MYVUE {126 async InsertVue (data = {}) {127 const res = await httpPost('/insertVueListItem', data);128 return res;129 }130 async GetVueList (params = {}) {131 const res = await httpGet('/getVueList', params);132 return res;133 }134 async DeleteVueList (params = {}) {135 const res = await httpGet('/deleteVueItem', params);136 return res;137 }138}139export const VUE = new MYVUE();140/**141 * 笔记 BaiduMap 相关接口142 * @GetBaiduMapList 查询 BaiduMap 列表143 * @InsertBaiduMap 新增/更新 BaiduMap 接口144 * @DeleteBaiduMapList 删除 BaiduMap 接口145 */146class BAIDUMAP {147 async InsertBaiduMap (data = {}) {148 const res = await httpPost('/insertBaiduMapListItem', data);149 return res;150 }151 async GetBaiduMapList (params = {}) {152 const res = await httpGet('/getBaiduMapList', params);153 return res;154 }155 async DeleteBaiduMapList (params = {}) {156 const res = await httpGet('/deleteBaiduMapItem', params);157 return res;158 }159}160export const BaiduMap = new BAIDUMAP();161/**162 * 笔记 Echarts 相关接口163 * @GetEchartsList 查询 Echarts 列表164 * @InsertEcharts 新增/更新 Echarts 接口165 * @DeleteEchartsList 删除 Echarts 接口166 */167class ECHARTS {168 async InsertEcharts (data = {}) {169 const res = await httpPost('/insertEchartsListItem', data);170 return res;171 }172 async GetEchartsList (params = {}) {173 const res = await httpGet('/getEchartsList', params);174 return res;175 }176 async DeleteEchartsList (params = {}) {177 const res = await httpGet('/deleteEchartsItem', params);178 return res;179 }180}181export const Echarts = new ECHARTS();182/**183 * 笔记 Express 相关接口184 * @GetExpressList 查询 Express 列表185 * @InsertExpress 新增/更新 Express 接口186 * @DeleteExpressList 删除 Express 接口187 */188class EXPRESS {189 async InsertExpress (data = {}) {190 const res = await httpPost('/insertExpressListItem', data);191 return res;192 }193 async GetExpressList (params = {}) {194 const res = await httpGet('/getExpressList', params);195 return res;196 }197 async DeleteExpressList (params = {}) {198 const res = await httpGet('/deleteExpressItem', params);199 return res;200 }201}202export const Express = new EXPRESS();203/**204 * 笔记 Webpack 相关接口205 * @GetWebpackList 查询 Webpack 列表206 * @InsertWebpack 新增/更新 Webpack 接口207 * @DeleteWebpackList 删除 Webpack 接口208 */209class WEBPACK {210 async InsertWebpack (data = {}) {211 const res = await httpPost('/insertWebpackListItem', data);212 return res;213 }214 async GetWebpackList (params = {}) {215 const res = await httpGet('/getWebpackList', params);216 return res;217 }218 async DeleteEWebpackList (params = {}) {219 const res = await httpGet('/deleteWebpackItem', params);220 return res;221 }222}223export const Webpack = new WEBPACK();224/**225 * 笔记 ElementUI 相关接口226 * @GetElementUIList 查询 ElementUI 列表227 * @InsertElementUI 新增/更新 ElementUI 接口228 * @DeleteElementUIList 删除 ElementUI 接口229 */230class ELEMENTUI {231 async InsertElementUI (data = {}) {232 const res = await httpPost('/insertElementUIListItem', data);233 return res;234 }235 async GetElementUIList (params = {}) {236 const res = await httpGet('/getElementUIList', params);237 return res;238 }239 async DeleteElementUIList (params = {}) {240 const res = await httpGet('/deleteElementUIItem', params);241 return res;242 }243}244export const MyElementUI = new ELEMENTUI();245/**246 * 笔记 Eslint 相关接口247 * @GetEslintList 查询 Eslint 列表248 * @InsertEslint 新增/更新 Eslint 接口249 * @DeleteEslintList 删除 Eslint 接口250 */251class ESLINT {252 async InsertEslint (data = {}) {253 const res = await httpPost('/insertEslintListItem', data);254 return res;255 }256 async GetEslintList (params = {}) {257 const res = await httpGet('/getEslintList', params);258 return res;259 }260 async DeleteEslintList (params = {}) {261 const res = await httpGet('/deleteEslintItem', params);262 return res;263 }264}265export const Eslint = new ESLINT();266/**267 * 笔记 VueCli 相关接口268 * @GetVueCliList 查询 VueCli 列表269 * @InsertVueCli 新增/更新 VueCli 接口270 * @DeleteVueCliList 删除 VueCli 接口271 */272class VUECLI {273 async InsertVueCli (data = {}) {274 const res = await httpPost('/insertVueCliListItem', data);275 return res;276 }277 async GetVueCliList (params = {}) {278 const res = await httpGet('/getVueCliList', params);279 return res;280 }281 async DeleteVueCliList (params = {}) {282 const res = await httpGet('/deleteVueCliItem', params);283 return res;284 }285}286export const VueCli = new VUECLI();287/**288 * 笔记 Tslint 相关接口289 * @GetTslintList 查询 Tslint 列表290 * @InsertTslint 新增/更新 Tslint 接口291 * @DeleteTslintList 删除 Tslint 接口292 */293class TSLINT {294 async InsertTslint (data = {}) {295 const res = await httpPost('/insertTslintListItem', data);296 return res;297 }298 async GetTslintList (params = {}) {299 const res = await httpGet('/getTslintList', params);300 return res;301 }302 async DeleteTslintList (params = {}) {303 const res = await httpGet('/deleteTslintItem', params);304 return res;305 }306}307export const Tslint = new TSLINT();308/**309 * 笔记 Mongodb 相关接口310 * @GetMongodbList 查询 Mongodb 列表311 * @InsertMongodb 新增/更新 Mongodb 接口312 * @DeleteMongodbList 删除 Mongodb 接口313 */314class MONGODB {315 async InsertMongodb (data = {}) {316 const res = await httpPost('/insertMongodbListItem', data);317 return res;318 }319 async GetMongodbList (params = {}) {320 const res = await httpGet('/getMongodbList', params);321 return res;322 }323 async DeleteMongodbList (params = {}) {324 const res = await httpGet('/deleteMongodbItem', params);325 return res;326 }327}328export const Mongodb = new MONGODB();329/**330 * 笔记 Css 相关接口331 * @GetCssList 查询 Css 列表332 * @InsertCss 新增/更新 Css 接口333 */334class MYCSS {335 async InsertCss (data = {}) {336 const res = await httpPost('/insertCssListItem', data);337 return res;338 }339 async GetCssList (params = {}) {340 const res = await httpGet('/getCssList', params);341 return res;342 }343 async DeleteCssList (params = {}) {344 const res = await httpGet('/deleteCssItem', params);345 return res;346 }347}348export const Css = new MYCSS();349/**350 * 笔记 Less 相关接口351 * @GetLessList 查询 Less 列表352 * @InsertLess 新增/更新 Less 接口353 */354class MYLESS {355 async InsertLess (data = {}) {356 const res = await httpPost('/insertLessListItem', data);357 return res;358 }359 async GetLessList (params = {}) {360 const res = await httpGet('/getLessList', params);361 return res;362 }363 async DeleteLessList (params = {}) {364 const res = await httpGet('/deleteLessItem', params);365 return res;366 }367}368export const Less = new MYLESS();369/**370 * 笔记 Sass 相关接口371 * @GetSassList 查询 Sass 列表372 * @InsertSass 新增/更新 Sass 接口373 */374class MYSASS {375 async InsertSass (data = {}) {376 const res = await httpPost('/insertSassListItem', data);377 return res;378 }379 async GetSassList (params = {}) {380 const res = await httpGet('/getSassList', params);381 return res;382 }383 async DeleteSassList (params = {}) {384 const res = await httpGet('/deleteSassItem', params);385 return res;386 }387}388export const Sass = new MYSASS();389/**390 * 笔记 Dom 相关接口391 * @GetDomList 查询 Dom 列表392 * @InsertDom 新增/更新 Dom 接口393 */394class MYDOM {395 async InsertDom (data = {}) {396 const res = await httpPost('/insertDomListItem', data);397 return res;398 }399 async GetDomList (params = {}) {400 const res = await httpGet('/getDomList', params);401 return res;402 }403 async DeleteDomList (params = {}) {404 const res = await httpGet('/deleteDomItem', params);405 return res;406 }407}408export const Dom = new MYDOM();409/**410 * 笔记 Ubuntu 相关接口411 * @GetUbuntuList 查询 Ubuntu 列表412 * @InsertUbuntu 新增/更新 Ubuntu 接口413 */414class UBUNTU {415 async InsertUbuntu (data = {}) {416 const res = await httpPost('/insertUbuntuListItem', data);417 return res;418 }419 async GetUbuntuList (params = {}) {420 const res = await httpGet('/getUbuntuList', params);421 return res;422 }423 async DeleteUbuntuList (params = {}) {424 const res = await httpGet('/deleteUbuntuItem', params);425 return res;426 }427}428export const Ubuntu = new UBUNTU();429/**430 * 笔记 Terminal 相关接口431 * @GetTerminalList 查询 Terminal 列表432 * @InsertTerminal 新增/更新 Terminal 接口433 */434class TERMINAL {435 async InsertTerminal (data = {}) {436 const res = await httpPost('/insertTerminalListItem', data);437 return res;438 }439 async GetTerminalList (params = {}) {440 const res = await httpGet('/getTerminalList', params);441 return res;442 }443 async DeleteTerminalList (params = {}) {444 const res = await httpGet('/deleteTerminalItem', params);445 return res;446 }447}448export const Terminal = new TERMINAL();449/**450 * 笔记 Algorithm 相关接口451 * @GetAlgorithmList 查询 Algorithm 列表452 * @InsertAlgorithm 新增/更新 Algorithm 接口453 */454class ALGORITHM {455 async InsertAlgorithm (data = {}) {456 const res = await httpPost('/insertAlgorithmListItem', data);457 return res;458 }459 async GetAlgorithmList (params = {}) {460 const res = await httpGet('/getAlgorithmList', params);461 return res;462 }463 async DeleteAlgorithmList (params = {}) {464 const res = await httpGet('/deleteAlgorithmItem', params);465 return res;466 }467}...

Full Screen

Full Screen

carSellHelpInter.js

Source:carSellHelpInter.js Github

copy

Full Screen

1import { HTTPGet, HTTPPost, HTTPPut } from '../utils/http'2export const carSellHelpInter = {3 // ===================================================== 品牌车型 ==============================================================4 // 品牌车型:加入对比5 VehicleAttributeVS: (arr) => { // modelIds 车型ID,数组格式[105,120,108]6 return HTTPGet(`/website/Vehicle/attribute?modelIds=${arr}`);7 },8 // 品牌车型:车型详情 (差一个车logo)9 getCarDetailInfo: (aliasName) => {10 return HTTPGet(`/website/api/getCarDetailInfo/${aliasName}`);11 },12 // 品牌车型:车型详情:更多车型13 getMoreCars: (aliasName) => {14 return HTTPGet(`/website/Car/getMoreCars/alias/${aliasName}`);15 },16 // 品牌车型:车型展示列表17 brandModelsList: () => {18 return HTTPGet(`/website/Car/brandModels`);19 },20 // 品牌车型:获取车型的价格和版本21 getVersion: (cid) => {22 return HTTPGet(`/website/Car/getVersion/cid/${cid}`);23 },24 // ===================================================== 纯正用品 ==============================================================25 // 纯正用品:用品分类26 gitViewLoadingEffect: (id) => {27 return HTTPGet(`/website/PureProducts/viewLoadingEffect/id/${id}`);28 },29 getClassifyPureProducts: () => {30 return HTTPGet(`/website/PureProducts/getClassify`);31 },32 // 纯正用品:用品列表 (调整中)33 getListPureProducts: (data) => {34 return HTTPPost(`/website/PureProducts/getList`, data);35 },36 // 纯正用品:用品详情37 getDetailPureProducts: (id) => {38 return HTTPGet(`/website/PureProducts/getDetail/id/${id}`);39 },40 // 纯正用品:我要咨询-提交41 consult: (data) => {42 return HTTPPost(`/website/PureProducts/consult`, data);43 },44 // 纯正用品:我要咨询:带入信息45 getUserInfoPureProducts: (data) => {46 return HTTPPost(`/website/PureProducts/getUserInfo/id/accessToken`, data);47 },48 // ===================================================== 下载中心 ==============================================================49 // 保存下载记录 (成功之后的提示语 是 查询成功 是否需要改正?)50 insertDownLoadRecord: (data) => {51 return HTTPPost(`/website/api/insertDownLoadRecord`, data);52 },53 // 下载中心:获取壁纸54 getWallpaper: (cid) => {55 return HTTPGet(`/website/api/getWallpaper/${cid}`);56 },57 // ===================================================== 金融服务 ==============================================================58 // 金融服务 融资租赁:促销活动列表 0金融促销活动,1融资租赁促销活动59 getFinanceActiveList: (type) => {60 return HTTPGet(`/website/api/getFinanceActiveList/${type}`);61 },62 // 金融服务:车型列表63 financeVehicleList: () => {64 return HTTPGet(`/website/api/financeVehicleList`);65 },66 // 金融服务:车型配置和价格67 VehicleVersionList: (cid) => {68 return HTTPGet(`/website/api/vehicleVersionList/${cid}`);69 },70 // 金融服务:获取金融机构71 financeOrganList: (cid) => {72 return HTTPGet(`/website/api/financeOrganList/${cid}`);73 },74 // 金融服务:获取产品类型75 financeProductTypeList: (versionid, organId) => {76 return HTTPGet(`/website/api/financeProductTypeList/${versionid}/${organId}`);77 },78 // 金融服务:获取产品列表79 financeProductList: (typeId, organId, versionId) => {80 return HTTPGet(`/website/api/financeProductList/${typeId}/${organId}/${versionId}`);81 },82 // 金融服务:产品详情83 financeProductDetail: (productId, versionId) => {84 return HTTPGet(`/website/api/financeProductDetail/${productId}/${versionId}`);85 },86 // 金融服务:生成方案87 financeProgram: (data) => {88 return HTTPPost(`/website/api/financeProgram`, data);89 },90 // ===================================================== 新车保险 ==============================================================91 // 新车保险、延保促销活动列表 促销活动分类type 0新车保险,1延保服务92 getInsuranceActiveList: (type) => {93 return HTTPGet(`/website/api/getInsuranceActiveList/${type}`);94 },95 // ===================================================== 融资租赁 ==============================================================96 // 融资租赁:易租贷计算器--丰田租赁97 toyotaLease: (data) => {98 return HTTPPost(`/website/api/toyotaLease`, data);99 },100 // 融资租赁:易租贷计算器--一汽租赁101 fawLease: (data) => {102 return HTTPPost(`/website/api/fawLease`, data);103 },104 // 融资租赁:易租贷计算器--易鑫租赁105 yiXinLease: (data) => {106 return HTTPPost(`/website/api/yiXinLease`, data);107 },108 // 融资租赁:易租贷计算器--获取租赁配置信息 code值为:丰田租赁:toyota_lease 一汽租赁:faw_lease109 getLeaseConfig: (code) => {110 return HTTPGet(`/website/api/getLeaseConfig/${code}`);111 },112 //零件溯源113 searchdetail: (data) => {114 return HTTPPost(`/website/Pures/searchDetail`, data);115 }...

Full Screen

Full Screen

api.js

Source:api.js Github

copy

Full Screen

1const $ = layui.jquery;2const request = (url, data, params) => {3 return new Promise((resolve, reject) => {4 contentType = 'application/x-www-form-urlencoded';5 if (data !== null && data !== undefined && (data.length > 0 || Object.keys(data).length > 0) && typeof data == 'object') {6 data = JSON.stringify(data)7 contentType = 'application/json'8 }9 $.ajax({10 url: url,11 type: params && params.type || 'post',12 dataType: params && params.dataType || 'JSON',13 contentType: contentType,14 data: data,15 success: function (res) {16 resolve(res)17 },18 error: function (res) {19 reject(res.message)20 }21 });22 });23}24const httpGet = (url) => {25 return request(url, {}, {26 type: 'GET',27 }).then(res => {28 if (res.status !== 'ok') {29 $message.error(res.message);30 }31 return res32 })33}34const httpDelete = (url, data) => {35 return request(url, data, {36 type: 'DELETE',37 }).then(res => {38 if (res.status !== 'ok') {39 $message.error(res.message);40 }41 return res42 })43}44const httpPost = (url, data) => {45 return request(url, data, {46 type: 'POST',47 }).then(res => {48 if (res.status !== 'ok') {49 $message.error(res.message);50 }51 return res52 })53}54const httpPut = (url, data) => {55 return request(url, data, {56 type: 'PUT',57 }).then(res => {58 if (res.status !== 'ok') {59 $message.error(res.message);60 }61 return res62 })63}64const httpPatch = (url, data) => {65 return request(url, data, {66 type: 'PATCH',67 }).then(res => {68 if (res.status !== 'ok') {69 $message.error(res.message);70 }71 return res72 })73}74const categories_get = () => {75 return httpGet('/master/categories')76}77const category_update = (data) => {78 return httpPut('/master/category', data)79}80const category_create = (data) => {81 return httpPost('/master/category', data)82}83const category_get = (id) => {84 return httpGet('/master/category?id=' + id)85}86const category_delete = (id) => {87 return httpDelete('/master/category?id=' + id)88}89const plugin_update = (data) => {90 return httpPut('/master/plugin', data)91}92const plugin_get = (id) => {93 return httpGet('/master/plugin?id=' + id)94}95const plugin_create = (data) => {96 return httpPost('/master/plugin', data)97}98const plugin_delete = (id) => {99 return httpDelete('/master/plugin?id=' + id)100}101const cloud_plugins_get = () => {102 return httpGet('/master/cloud/plugins')103}104const cloud_plugin_get = (id) => {105 return httpGet('/master/cloud/plugin?id=' + id)106}107const cloud_plugin_install = (id) => {108 return httpGet('/master/cloud/plugin_install?id=' + id)109}110const cloud_categories_get = () => {111 return httpGet('/master/cloud/categories')112}113const cloud_releases_get = () => {114 return httpGet('/master/cloud/releases')115}116const user_update = (data) => {117 return httpPut('/master/user', data)118}119const user_get = (id) => {120 return httpGet('/master/user?id=' + id)121}122const user_delete = (id) => {123 return httpDelete('/master/user?id=' + id)124}125const system_update = (data) => {126 return httpPost('/master/system', data)127}128const system_get = () => {129 return httpGet('/master/system')130}131const templates_get = () => {132 return httpGet('/master/system/templates')133}134const plugin_templates_get = () => {135 return httpGet('/master/system/plugin_templates')136}137const ota_check = () => {138 return httpGet('/master/ota/check')139}140const ota_update = () => {141 return httpGet('/master/ota/update')142}143const ota_update_database = () => {144 return httpGet('/master/ota/database')145}146const ota_update_script = () => {147 return httpGet('/master/ota/script')148}149const plugin_total_request_count = () => {150 return httpGet('/master/analysis/plugin_total_request_count')151}152const plugin_max_request_count = () => {153 return httpGet('/master/analysis/plugin_max_request_count')154}155const plugin_request_count = () => {156 return httpGet('/master/analysis/plugin_request_count')157}158const user_active_count = () => {159 return httpGet('/master/analysis/user_active_count')160}161const user_increase_count = () => {162 return httpGet('/master/analysis/user_increase_count')163}164const system_info_get = () => {165 return httpGet('/master/system/info')...

Full Screen

Full Screen

carOwner.js

Source:carOwner.js Github

copy

Full Screen

1import { HTTPGet, HTTPPost } from '../utils/http'2export const carOwner = {3 // ===================================================== 车主专享 ==============================================================4 // 服务介绍:服务产品:延保计算器5 extenInSur: (params) => {6 return HTTPPost(`/website/api/extentionCalculator`,params);7 },8 //服务大厅:获取保养计划车型列表9 getMaintainCarType: () => {10 return HTTPGet(`/website/api/getMaintainCarType`);11 },12 // 服务大厅:保养计划查询13 maintain: (params) => {14 return HTTPPost(`/website/api/maintainPlan`,params);15 },16 // 服务大厅:违章查询带入用户车架号17 getCarCode: () => {18 return HTTPGet(`/website/api/getCarCode`);19 },20 // 服务大厅:违章查询21 TrafficViolationsList: (params) => {22 return HTTPPost(`/website/api/TrafficViolationsList`,params);23 },24 // 服务活动:文章列表25 carList: (page,row) => {26 return HTTPGet(`/website/News/carList?page=${page}&row=${row}`);27 },28 // 服务活动:文章详情29 carDetail: (id) => {30 return HTTPGet(`/website/News/carDetail?id=${id}`);31 },32 // 纯牌零件:零件列表33 getList: (id) => {34 return HTTPGet(`/website/Component/getList/id/${id}`);35 },36 // 纯牌零件:零件详情37 getDetail: (id) => {38 return HTTPGet(`/website/Component/getDetail/id/${id}`);39 },40 // 纯牌零件:一级分类41 getFirstClassify: () => {42 return HTTPGet(`/website/Component/getFirstClassify`);43 },44 // 纯牌零件:二级分类45 getSecondClassify: (data) => {46 return HTTPPost(`/website/Component/getSecondClassify`,data);47 },48 // 丰享汇:最新活动列表49 CurActivityList: () => {50 return HTTPGet(`/website/api/CurActivityList`);51 },52 // 丰享汇:往期活动列表53 PastActivityList: (data) => {54 return HTTPPost(`/website/api/PastActivityList`,data);55 },56 // 丰享汇:活动详情57 ActivityDetail: (id) => {58 return HTTPGet(`/website/api/ActivityDetail/${id}`);59 },60 // 服务活动:杂志列表61 getMagazineList: (data) => {62 return HTTPPost(`/website/api/getMagazineList`,data);63 },64 // 服务活动:杂志详情65 getMagazineDetail: (magazineId) => {66 return HTTPGet(`/website/api/getMagazineDetail/${magazineId}`);67 },68 // 服务大厅:预约保养、预约维修获取用户登录信息与爱车信息69 getUserInfo: (accessToken) => {70 return HTTPPost(`/website/Maintenance/getUserInfo`,accessToken);71 },72 // 服务大厅:预约保养:发短信73 // 服务大厅:预约保养:立即预约74 addMaintenance: (data) => {75 return HTTPPost(`/website/Maintenance/addMaintenance`,data);76 },77 // 服务大厅:预约维修:立即预约78 repair: (data) => {79 return HTTPPost(`/website/Maintenance/repair`,data);80 },81 // 服务大厅:违章查询:省份简称列表(车牌号码)82 getProvinceBrief: (data) => {83 return HTTPGet('/website/api/getProvinceBrief');84 },85 // 丰享汇:车主入会列表86 getOwnerStory: (data) => {87 return HTTPGet('/website/News/getOwnerStory?type=story&page=1&row=10');88 },89 // 丰享汇:车主入会详情90 getOwnerStoryDetail: (id) => {91 return HTTPGet(`/website/News/getOwnerStoryDetail/id/${id}`)92 }93 94 ...

Full Screen

Full Screen

stockService.js

Source:stockService.js Github

copy

Full Screen

1import { httpGet, httpPost, httpDelete, httpPut } from './http';2export async function searchStock(payload) {3 return httpPost(`stock/search`, { page: 0, size: 20, ...payload });4}5export async function searchSingleStock(symbol) {6 if (!symbol) {7 throw new Error(`Symbol is not specified`);8 }9 return httpPost(`stock/search/${symbol}`);10}11export async function getStock(symbol) {12 return httpGet(`stock/s/${symbol}`);13}14export async function getStockForGuest(symbol) {15 return httpGet(`stock/s/${symbol}/guest_info`);16}17export async function getStockNextReportDate(symbol) {18 return httpGet(`stock/s/${symbol}/next_report_date`);19}20export async function getStockEvcInfo(symbol) {21 return httpGet(`stock/s/${symbol}/evc_info`);22}23export async function getStockDataInfo(symbol) {24 return httpGet(`stock/s/${symbol}/data_info`);25}26export async function incrementStock(symbol) {27 return httpGet(`stock/s/${symbol}/inc`);28}29export async function listHotStock(size = 10) {30 return httpGet(`stock/hot`, { size });31}32export async function listStock() {33 return httpGet(`stock/list`);34}35export async function deleteStock(symbol) {36 return httpDelete(`stock/s/${symbol}`);37}38export async function createStock(stock) {39 return httpPut(`stock`, stock);40}41export async function updateStock(stock) {42 return httpPost(`stock/s/${stock.symbol}`, stock);43}44export async function listStockSupport(symbol) {45 return httpGet(`stock/s/${symbol}/support`);46}47export async function saveStockSupport(symbol, lo, hi) {48 return httpPost(`stock/s/${symbol}/support`, { lo, hi });49}50export async function existsStock(symbol) {51 return httpGet(`stock/s/${symbol}/exists`);52}53export async function deleteStockSupport(id) {54 return httpDelete(`stock/support/${id}`);55}56export async function listStockResistance(symbol) {57 return httpGet(`stock/s/${symbol}/resistance`);58}59export async function saveStockResistance(symbol, lo, hi) {60 return httpPost(`stock/s/${symbol}/resistance`, { lo, hi });61}62export async function deleteStockResistance(id) {63 return httpDelete(`stock/resistance/${id}`);64}65export async function listStockEps(symbol) {66 return httpGet(`stock/s/${symbol}/eps`);67}68export async function saveStockEps(symbol, values) {69 return httpPost(`stock/s/${symbol}/eps`, values);70}71export async function syncStockEps(symbol) {72 return httpPost(`stock/s/${symbol}/eps/sync`);73}74export async function factorStockValue(symbol, date, factor) {75 return httpPost(`stock/s/${symbol}/factor`, { date, factor });76}77export async function deleteStockEps(symbol, reportDate) {78 return httpDelete(`stock/eps/${symbol}/${reportDate}`);79}80export async function listStockFairValue(symbol) {81 return httpGet(`stock/s/${symbol}/fairvalue`);82}83export async function saveStockFairValue(symbol, payload) {84 return httpPost(`stock/s/${symbol}/fairvalue`, payload);85}86export async function deleteStockFairValue(id) {87 return httpDelete(`stock/fairvalue/${id}`);88}89export async function getMarketMostActive() {90 return httpGet(`/stock/data/mostactive`);91}92export async function getMarketGainers() {93 return httpGet(`/stock/data/gainers`);94}95export async function getMarketLosers() {96 return httpGet(`/stock/data/losers`);97}98export async function getEarningsCalender(week = 0) {99 return httpGet(`/stock/data/earnings_calendar`, { week });100}101export async function getStockInsiderTransaction(symbol) {102 return httpGet(`/stock/s/${symbol}/insider`);103}104export async function getStockRoster(symbol) {105 return httpGet(`/stock/s/${symbol}/roster`);106}107export async function getStockNews(symbol) {108 return httpGet(`/stock/s/${symbol}/news`);109}110export async function getStockQuote(symbol) {111 return httpGet(`/stock/s/${symbol}/quote`);112}113export async function getStockPutCallRatioChart(symbol) {114 return httpGet(`/stock/s/${symbol}/chart/putcallratio`);115}116export async function submitStockPlea(symbol) {117 return httpPost(`stock/plea/${symbol}`);118}119export async function deleteStockPlea(symbol) {120 return httpDelete(`stock/plea/${symbol}`);...

Full Screen

Full Screen

app.js

Source:app.js Github

copy

Full Screen

1window.onload = function () {2document.addEventListener("keydown", keyDown);3document.addEventListener("keyup", keyUp);4let endpoint = 'https://loud-eagle-9.localtunnel.me/api'5var toggleForW = 0;6let wbutton = document.getElementById("W");7wbutton.addEventListener("touchstart", function(){8 console.log('forward')9 httpGet(endpoint + '/forward')10})11wbutton.addEventListener("touchend", function(){12 httpGet(endpoint + '/stop')13 console.log('stop')14})15let abutton = document.getElementById("A");16abutton.addEventListener("touchstart", function(){17 console.log('left')18 httpGet(endpoint + '/goLeft')19})20abutton.addEventListener("touchend", function(){21 httpGet(endpoint + '/straight')22 console.log('straight')23})24let sbutton = document.getElementById("S");25sbutton.addEventListener("touchstart", function(){26 console.log('back')27 httpGet(endpoint + '/back')28})29sbutton.addEventListener("touchend", function(){30 httpGet(endpoint + '/stop')31 console.log('stop')32})33let dbutton = document.getElementById("D");34dbutton.addEventListener("touchstart", function(){35 console.log('right')36 httpGet(endpoint + '/goRight')37})38dbutton.addEventListener("touchend", function(){39 httpGet(endpoint + '/straight')40 console.log('straight')41})42let dancebutton = document.getElementById("dance");43dancebutton.addEventListener("touchstart", function(){44 console.log('dance')45 httpGet(endpoint + '/dance')46})47let passengerbutton = document.getElementById("passenger");48passengerbutton.addEventListener("touchstart", function(){49 console.log('passenger')50 passengerbutton.classList.toggle('active')51 httpGet(endpoint + '/openPassengerDoor')52})53let driverbutton = document.getElementById("driver");54driverbutton.addEventListener("touchstart", function(){55 console.log('driver')56 driverbutton.classList.toggle('active')57 httpGet(endpoint + '/openDriverDoor')58})59function keyDown(e){60 console.log(e);61 if (e.key.toUpperCase() == "W"){62 document.getElementById("W").classList.toggle('active')63 httpGet(endpoint + '/forward')64 }65 if (e.key.toUpperCase() == "A"){66 document.getElementById("A").classList.toggle('active')67 httpGet(endpoint + '/goLeft')68 }69 if (e.key.toUpperCase() == "S"){70 document.getElementById("S").classList.toggle('active')71 httpGet(endpoint + '/back')72 }73 if (e.key.toUpperCase() == "D"){74 document.getElementById("D").classList.toggle('active')75 httpGet(endpoint + '/goRight')76 }77}78function keyUp(e){79 if (e.key.toUpperCase() == "W"){80 document.getElementById("W").classList.toggle('active')81 httpGet(endpoint + '/stop')82 }83 if (e.key.toUpperCase() == "A"){84 document.getElementById("A").classList.toggle('active')85 httpGet(endpoint + '/straight')86 }87 if (e.key.toUpperCase() == "S"){88 document.getElementById("S").classList.toggle('active')89 httpGet(endpoint + '/straight')90 }91 if (e.key.toUpperCase() == "D"){92 document.getElementById("D").classList.toggle('active')93 httpGet(endpoint + '/stop')94 }95 if (e.key.toUpperCase() == "F"){96 document.getElementById("dance").classList.toggle('active')97 httpGet(endpoint + '/dance')98 }99 if (e.key.toUpperCase() == "G"){100 document.getElementById("passenger").classList.toggle('active')101 httpGet(endpoint + '/openPassengerDoor')102 }103 if (e.key.toUpperCase() == "H"){104 document.getElementById("driver").classList.toggle('active')105 httpGet(endpoint + '/openDriverDoor')106 }107}108function httpGet(theUrl)109{110 var xmlHttp = new XMLHttpRequest();111 xmlHttp.open( "GET", theUrl, true ); // false for synchronous request112 xmlHttp.setRequestHeader('Access-Control-Allow-Origin', 'https://web-car-controller.firebaseapp.com');113 xmlHttp.send( null );114 return xmlHttp.responseText;115}...

Full Screen

Full Screen

api-service.js

Source:api-service.js Github

copy

Full Screen

1import {httpGet} from "../api-client";2export async function getPublicActions(more, limit) {3 const response = await httpGet("/public-actions/", {4 more: more || 0,5 limit: limit || 106 });7 return response.data ? response.data : {};8}9export async function getPublicAction(id) {10 const response = await httpGet(`/public-actions/${id}`);11 return response.data ? response.data : {};12}13export async function getActions() {14 const response = await httpGet("/actions");15 return response.data ? response.data : [];16}17export async function getAction(actionId) {18 const response = await httpGet(`/actions/${actionId}`);19 return response.data;20}21export async function getPrinciples() {22 const principlesResponse = await httpGet("/principles/");23 return principlesResponse.data;24}25export async function getPrinciple(principleId) {26 const response = await httpGet(`/principles/${principleId}`);27 return response.data;28}29export async function getSustainableDevelopmentGoals() {30 const principlesResponse = await httpGet("/sustainable-development-goals/");31 return principlesResponse.data;32}33export async function getSustainableDevelopmentGoal(goalId) {34 const response = await httpGet(`/sustainable-development-goals/${goalId}`);35 return response.data;36}37export async function getSDGObjective(sdgObjectiveId) {38 const response = await httpGet(`/sdg-objectives/${sdgObjectiveId}`);39 return response.data;40}41export async function getSDGMonitoringData(params) {42 const response = await httpGet(`/sdg-monitoring/`, params);43 return response.data;44}45export async function getPartners() {46 const partnersResponse = await httpGet("/partners");47 return partnersResponse.data;48}49export async function getPartner(partnerId) {50 const partnerResponse = await httpGet(`/partners/${partnerId}`);51 return partnerResponse.data;52}53export async function getDashboard(params) {54 const response = await httpGet("/dashboard", params);55 return response.data ? response.data : [];56}57export async function getBalance(params) {58 return httpGet("/balance", params);59}60export async function getMyStats(params) {61 const response = await httpGet("/my-stats", params);62 return response.data ? response.data : [];63}64export async function getPeriods(params) {65 const response = await httpGet("/periods", params);66 return response.data ? response.data : [];...

Full Screen

Full Screen

juggling-async.js

Source:juggling-async.js Github

copy

Full Screen

1'use strict';2const https = require('https');3function httpGet(url) {4 return new Promise( function (resolve, reject) {5 https.get(url, function (res) {6 let buffer = '';7 res.on("data", data => buffer += data);8 res.on("end", () => resolve(buffer));9 res.on("error", err => reject(err));10 })11 })12}13/*14httpGet(process.argv[2]).then( function (buffer) {15 console.log(buffer);16 httpGet(process.argv[3]).then( function(buffer) {17 console.log(buffer);18 httpGet(process.argv[4]).then(function (buffer) {19 console.log(buffer);20 })21 })22});23 */24const show = async () => {25 console.log(await httpGet(process.argv[2]));26 console.log(await httpGet(process.argv[3]));27 console.log(await httpGet(process.argv[4]));28};29//show();30httpGet('https://straffesites.be')31 .then(buffer => {32 console.log(buffer);33 return httpGet('https://google.be');34 })35 .then(buffer => {36 console.log(buffer);37 return httpGet('https://vercel.com');38 })39 .then(buffer => console.log(buffer))40 .catch(error => console.error(error));41/*42Promise.all([httpGet(process.argv[2]), httpGet(process.argv[3]), httpGet(process.argv[4])])43 .then(console.log)44 .catch(console.error);...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1const puppeteer = require('puppeteer');2(async () => {3 const browser = await puppeteer.launch();4 const page = await browser.newPage();5 await page.screenshot({path: 'example.png'});6 await browser.close();7})();8 body {9 font-family: 'TH Sarabun New', sans-serif;10 font-size: 16px;11 }12const puppeteer = require('puppeteer');13(async () => {14 const browser = await puppeteer.launch();15 const page = await browser.newPage();16 await page.pdf({path: 'hn.pdf', format: 'A4'});17 await browser.close();18})();

Full Screen

Using AI Code Generation

copy

Full Screen

1const puppeteer = require('puppeteer');2const fs = require('fs');3(async () => {4 const browser = await puppeteer.launch();5 const page = await browser.newPage();6 await page.goto('

Full Screen

Using AI Code Generation

copy

Full Screen

1const puppeteer = require('puppeteer');2(async () => {3 const browser = await puppeteer.launch();4 const page = await browser.newPage();5 console.log(await response.text());6 await browser.close();7})();

Full Screen

Using AI Code Generation

copy

Full Screen

1const puppeteer = require('puppeteer');2const httpGET = async (url) => {3const browser = await puppeteer.launch();4const page = await browser.newPage();5await page.goto(url);6const content = await page.content();7await browser.close();8return content;9};10httpGET(url).then((content) => {11console.log(content);12});

Full Screen

Using AI Code Generation

copy

Full Screen

1const puppeteer = require('puppeteer');2const http = require('http');3const port = 3000;4const requestHandler = (request, response) => {5 console.log(request.url);6 response.end('Hello Node.js Server!');7}8const server = http.createServer(requestHandler);9server.listen(port, (err) => {10 if (err) {11 return console.log('something bad happened', err);12 }13 console.log(`server is listening on ${port}`);14});15(async () => {16 const browser = await puppeteer.launch({headless: true});17 const page = await browser.newPage();18 await page.screenshot({path: 'example.png'});19 await browser.close();20})();

Full Screen

Using AI Code Generation

copy

Full Screen

1const puppeteer = require('puppeteer');2const http = require('http');3const url = require('url');4const querystring = require('querystring');5const port = 3000;6const requestHandler = (request, response) => {7 console.log(request.url)8 var queryData = url.parse(request.url, true).query;9 console.log(queryData)10 response.end('Hello Node.js Server!')11 if (request.method == 'POST') {12 var body = '';13 request.on('data', function (data) {14 body += data;15 });16 request.on('end', function () {17 var POST = querystring.parse(body);18 console.log(POST);19 });20 }21 if (request.method == 'GET') {22 var body = '';23 request.on('data', function (data) {24 body += data;25 });26 request.on('end', function () {27 var GET = querystring.parse(body);28 console.log(GET);29 });30 }31}32const server = http.createServer(requestHandler)33server.listen(port, (err) => {34 if (err) {35 return console.log('something bad happened', err)36 }37 console.log(`server is listening on ${port}`)38})39(async () => {40 const browser = await puppeteer.launch();41 const page = await browser.newPage();42 await page.screenshot({ path: 'example.png' });43 await browser.close();44})();45const puppeteer = require('puppeteer');46const http = require('http');47const url = require('url');48const querystring = require('querystring');49const port = 3000;50const requestHandler = (request, response) => {51 console.log(request.url)52 var queryData = url.parse(request.url, true).query;53 console.log(queryData)54 response.end('Hello Node.js Server!')55 if (request.method == 'POST') {56 var body = '';57 request.on('data', function (data) {58 body += data;59 });60 request.on('end', function ()

Full Screen

Using AI Code Generation

copy

Full Screen

1const puppeteer = require('puppeteer');2(async () => {3const browser = await puppeteer.launch();4const page = await browser.newPage();5await page.goto(url);6console.log(html);7await browser.close();8})();9const puppeteer = require('puppeteer');10(async () => {11const browser = await puppeteer.launch();12const page = await browser.newPage();13await page.goto(url);14await page.evaluate(() => {15const data = { name: 'John', age: 31, city: 'New York' };16fetch('/api', {17headers: {18}19}).then(res => res.json())20.then(response => console.log('Success:', JSON.stringify(response)))21.catch(error => console.error('Error:', error));22});23await browser.close();24})();

Full Screen

Using AI Code Generation

copy

Full Screen

1const puppeteer = require('puppeteer');2const httpGET = require('./httpGET');3const fs = require('fs');4const path = require('path');5(async () => {6 const browser = await puppeteer.launch();7 const page = await browser.newPage();8 await page.screenshot({path: 'google.png'});9 await browser.close();10})();11const puppeteer = require('puppeteer');12const fs = require('fs');13const path = require('path');14module.exports = async (url, savePath) => {15 const browser = await puppeteer.launch();16 const page = await browser.newPage();17 await page.goto(url);18 await page.screenshot({path: savePath});19 await browser.close();20};21const puppeteer = require('puppeteer');22const httpGET = require('./httpGET');23const fs = require('fs');24const path = require('path');25(async () => {26 const browser = await puppeteer.launch();27 const page = await browser.newPage();28 await page.screenshot({path: 'google.png'});29 await browser.close();30})();

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Puppeteer automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful