23 行
553 B
JavaScript
23 行
553 B
JavaScript
import axios from 'axios'
|
|
import {appConfig} from "../config"
|
|
import Swal from "sweetalert2"
|
|
|
|
let myAxios=axios.create({
|
|
baseURL:appConfig.baseUrl
|
|
})
|
|
export function textbookTitleRefine(str){
|
|
return firstUpperCase(str.split('-').slice(1).join(' '))
|
|
}
|
|
export function firstUpperCase(str) {
|
|
return str.toLowerCase().replace(/( |^)[a-z]/g, (L) => L.toUpperCase())
|
|
}
|
|
export function showServerErrorAlert(){
|
|
Swal.fire({
|
|
title: '错误',
|
|
icon: 'error',
|
|
text: '拉取伺服器资料时出错'
|
|
})
|
|
}
|
|
|
|
export {myAxios}
|