Browse Source

生成环境配置

master
453530270@qq.com 2 years ago
parent
commit
37b126b198
  1. 2
      api/login/index.js
  2. 5
      config.js
  3. 5
      utils/request/index.js

2
api/login/index.js

@ -1,7 +1,7 @@
import request from '@/utils/request'
// 前缀
const prefix ="dev-api/"
const prefix ="slb/"
// api地址
const api = {

5
config.js

@ -6,7 +6,10 @@ module.exports = {
// 必填: 后端api地址, 斜杠/结尾, 参照下面格式
// 例如: https://www.你的域名.com/index.php?s=/api/
//apiUrl: "http://192.168.66.16:8089/index.php?s=/api/",
apiUrl: "http://58.30.231.137:8022/",
// dev env
// apiUrl: "http://58.30.231.137:8022/",
// product env
apiUrl: "http://10.24.4.14:80/",
/**
* 是否启用商城设置缓存

5
utils/request/index.js

@ -18,7 +18,8 @@ const $http = new request({
defaultUploadUrl: 'upload/image',
// 设置请求头(如果使用报错跨域问题,可能是content-type请求类型和后台那边设置的不一致)
header: {
'content-type': 'application/json;charset=utf-8'
'content-type': 'application/json;charset=utf-8',
'Accept', 'application/json;charset=UTF-8'
},
// 请求超时时间, 单位ms(默认15000)
timeout: 15000,
@ -66,7 +67,7 @@ $http.requestStart = options => {
// 请求前加入当前终端
options.header['platform'] = store.getters.platform
// 请求前加入Token
options.header['Access-Token'] = store.getters.token
options.header['normal_login_token'] = store.getters.token
// return false 表示请求拦截,不会继续请求
return options
}

Loading…
Cancel
Save