Explorar el Código

优化代码

ms
zhoujie hace 2 años
padre
commit
9de4453a1b
Se han modificado 1 ficheros con 7 adiciones y 1 borrados
  1. 7
    1
      utils/network/request.js

+ 7
- 1
utils/network/request.js Ver fichero

@@ -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'
//设置请求超时时间

Cargando…
Cancelar
Guardar