cc-api-next
Advanced tools
Comparing version 1.0.4 to 1.0.5
const fetch = require('isomorphic-unfetch'); | ||
import Cookies from 'universal-cookie'; | ||
const cookies = new Cookies(); | ||
class Api { | ||
@@ -20,9 +17,7 @@ | ||
setToken(token){ | ||
this.headers['x-token'] = token || cookies.get(this.tokenKey); | ||
this.headers['x-token'] = token; | ||
} | ||
async call(path, data, config) { | ||
if(!this.headers['x-token']){ | ||
this.setToken(); | ||
} | ||
if(config === undefined){ | ||
@@ -29,0 +24,0 @@ config = data || {}; |
{ | ||
"name": "cc-api-next", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "cc api next", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
1700
40