hyapp-utils
Advanced tools
Comparing version 1.0.7 to 1.0.8
@@ -5,8 +5,7 @@ import Tools from './src/tools' | ||
class Utils { | ||
constructor ({url, baseurl}) { | ||
this.url = url | ||
constructor ({baseurl}) { | ||
this.baseurl = baseurl | ||
} | ||
install(Vue) { | ||
Vue.use(new Http(this.url, this.baseurl)) | ||
Vue.use(new Http(this.baseurl)) | ||
} | ||
@@ -13,0 +12,0 @@ } |
{ | ||
"name": "hyapp-utils", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "'hyapp utils'", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -23,4 +23,4 @@ import axios from 'axios' | ||
export default class Http { | ||
constructor({url, baseUrl = ''}){ | ||
this._url = baseUrl+ url | ||
constructor({baseUrl = ''}){ | ||
this.baseUrl = baseUrl | ||
return this | ||
@@ -33,3 +33,3 @@ } | ||
return new Promise((resolve, reject) => { | ||
axios.get(self._url, options.config = {}).then(rst => { | ||
axios.get(this.baseUrl+options.url, options.config = {}).then(rst => { | ||
errorTipHandle(rst) | ||
@@ -43,5 +43,5 @@ resolve(rst) | ||
Vue.prototype.$post = options => { | ||
const {data, config} = options | ||
const {url, data, config} = options | ||
return new Promise((resolve, reject) => { | ||
axios.post(this.url, data, config).then(rst => { | ||
axios.post(this.baseUrl+url, data, config).then(rst => { | ||
errorTipHandle(rst) | ||
@@ -48,0 +48,0 @@ resolve(rst) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7625
192