Skip to content

Instantly share code, notes, and snippets.

View superlbr's full-sized avatar
🎯
Focusing

Baorong Li superlbr

🎯
Focusing
  • China
View GitHub Profile
@superlbr
superlbr / request.js
Last active October 10, 2019 03:03
request using axios in miniprogram
'use strict'
/** copy axios.min.js */
import axios from 'axios'
import Tips from './Tips'
const host = process.env.NODE_ENV === 'production' ? 'https://xxx.com' : 'http://localhost:3003'
axios.defaults.baseURL = `${host}/api`
axios.defaults.timeout = 10000