Skip to content

Instantly share code, notes, and snippets.

View Xiaohantx's full-sized avatar
🏠
Working from the company

小晗同学 Xiaohantx

🏠
Working from the company
View GitHub Profile
@Xiaohantx
Xiaohantx / down-file.js
Last active April 16, 2020 08:45
文件blob下载
const blob = new Blob([res.data], {
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
// 文件格式
})
if ('download' in document.createElement('a')) { // 非IE下载
const elink = document.createElement('a')
elink.download = 'markone'
elink.style.display = 'none'
elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink)
[
{
"children": [
{
"hidden": true,
"path": "/",
"redirect": "/dashboard"
},
{
"component": "dashboard/index",
export const baseURL = process.env.NODE_ENV === 'production'
? '/api/'
: ''
import axios from 'axios'
import { baseURL } from '@/config'
class HttpRequest {
constructor (baseUrl = baseURL) {
this.baseUrl = baseUrl
this.queue = {}
}
getInsideConfig () {
const config = {