摘要: nodejs 实现接口 使用 express 模块 1. 在 api.js 中: var express = require('express'); var app=express(); var bodyParser = require('body-parser'); app.use(bodyPar 阅读全文
posted @ 2019-10-04 12:30 monkey-K 阅读(1313) 评论(0) 推荐(0) 编辑
摘要: 1. 新建一个 proxy.conf.json { "/search": { "target": "https://wenku.baidu.com/search", "secure": false, "changeOrigin": true }, "/getnotice": { "target":  阅读全文
posted @ 2019-10-04 12:25 monkey-K 阅读(2442) 评论(0) 推荐(0) 编辑
摘要: angular 中使用 axios /** * 在angular 中引入第三方 http 模块的使用, 以 axios 为例 * 有两种使用方法:(本文使用Promise简单封装) * 一. 直接在要使用请求的组件中 import axios from 'axios', 调用: axios.get/ 阅读全文
posted @ 2019-10-04 12:07 monkey-K 阅读(3137) 评论(0) 推荐(0) 编辑
摘要: angular 中使用 http 请求的前提,需要引入 httpClientModule 模块 根模块中 app.module.ts: import { HttpClientModule } from '@angular/common/http' imports: [ BrowserModule, 阅读全文
posted @ 2019-10-04 12:01 monkey-K 阅读(2113) 评论(0) 推荐(0) 编辑