@@ -1,7 +1,9 @@ | |||
import { | |||
encryption | |||
} from "./encryption" | |||
import { | |||
getToken | |||
} from '@/utils/storage' | |||
/** | |||
* 配置信息,针对不同的平台进行配置 | |||
*/ | |||
@@ -33,6 +35,10 @@ export function request(code, options = {}) { | |||
options.header = { | |||
'content-type': contentType | |||
} | |||
const token = getToken(); | |||
if (token) { | |||
options.header["Access-Token"] = token; | |||
} | |||
//默认POST提交 | |||
options.method = options.method ? options.method : 'POST' | |||
//设置请求超时时间 |