yz-module-tools
v0.0.3
Published
yz-module-tool,yz
Downloads
2
Readme
- 接口签名
- 获取文件(接口签名衍生)
安装
import { install as YzToolsInstall } from 'yz-module-tools'
import axios from 'axios'
Vue.use(YzToolsInstall, {
secret: 'yizheng2020',
axios
})
接口签名 案例
import { yzTools } from 'yz-module-tools'
import axios from 'axios'
// 请求拦截
axios.interceptors.request.use(function (request) {
<!-- 添加签名 -->
yzTools.addSignature(request)
return request
}
// 获取文件
this.$yzTools.getImgAndBase64(self.$config.filePath + self.noticeList[0].notice_picture)