Browse Source

地址分环境

hella_vue3
zhang_li 7 months ago
parent
commit
19a677fcc1
  1. 3
      .env.development
  2. 2
      .env.hella13
  3. 2
      .env.hella14
  4. 2
      .env.hella15
  5. 2
      .env.hella16
  6. 2
      .env.hella8
  7. 2
      .env.hella9
  8. 2
      .env.production
  9. 3
      .env.test
  10. 3
      src/api/httpRequest3.js
  11. 6
      src/api/request2.js

3
.env.development

@ -0,0 +1,3 @@
VITE_BASE_URL=http://dev.ccwin-in.com:25300/api/admin-api
VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25300/admin-api

2
.env.hella13

@ -0,0 +1,2 @@
VITE_BASE_URL=http://dev.ccwin-in.com:25300/api/admin-api
VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25300/admin-api

2
.env.hella14

@ -0,0 +1,2 @@
VITE_BASE_URL=http://dev.ccwin-in.com:25300/api/admin-api
VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25300/admin-api

2
.env.hella15

@ -0,0 +1,2 @@
VITE_BASE_URL=http://dev.ccwin-in.com:25300/api/admin-api
VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25300/admin-api

2
.env.hella16

@ -0,0 +1,2 @@
VITE_BASE_URL=http://dev.ccwin-in.com:25300/api/admin-api
VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25300/admin-api

2
.env.hella8

@ -0,0 +1,2 @@
VITE_BASE_URL=http://dev.ccwin-in.com:25300/api/admin-api
VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25300/admin-api

2
.env.hella9

@ -0,0 +1,2 @@
VITE_BASE_URL=http://dev.ccwin-in.com:25300/api/admin-api
VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25300/admin-api

2
.env.production

@ -0,0 +1,2 @@
VITE_BASE_URL=http://dev.ccwin-in.com:25300/api/admin-api
VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25300/admin-api

3
.env.test

@ -0,0 +1,3 @@
VITE_BASE_URL=http://dev.ccwin-in.com:25300/api/admin-api
VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25300/admin-api

3
src/api/httpRequest3.js

@ -1,6 +1,5 @@
import storage from '../common/utils/storage' import storage from '../common/utils/storage'
import config from '../static/config.js'
function service(options = {}) { function service(options = {}) {
var token = storage.getStorage(storage.constant.token) var token = storage.getStorage(storage.constant.token)
@ -13,7 +12,7 @@ function service(options = {}) {
// requestUrl = getApp().globalData.request_url // requestUrl = getApp().globalData.request_url
// } // }
var requestUrl = "" var requestUrl = ""
requestUrl =config.request_url requestUrl = import.meta.env.VITE_BASE_URL
options.header = { options.header = {
"content-type": "application/json", "content-type": "application/json",

6
src/api/request2.js

@ -1,10 +1,8 @@
import request from './httpRequest3.js' import request from './httpRequest3.js'
import storage from '../common/utils/storage.js' import storage from '../common/utils/storage.js'
import config from '../static/config.js'
// const baseApi = "/api/admin-api"
//公司地址 //公司地址
// 本地地址 // 本地地址
const baseApi = "" const baseApi = ''
/** /**
* 获取验证码 * 获取验证码
* @param {*} * @param {*}
@ -3811,7 +3809,7 @@ export function getFileList(tableName, tableId) {
*/ */
export function uploadFile(tableName, tableId, filePath, callBack) { export function uploadFile(tableName, tableId, filePath, callBack) {
var token = storage.getStorage(storage.constant.token) var token = storage.getStorage(storage.constant.token)
var url = config.request_url + baseApi var url = import.meta.env.VITE_BASE_URL + baseApi
uni.uploadFile({ uni.uploadFile({
url: url + "/infra/file/upload?tableName=" + tableName + "&tableId=" + tableId, url: url + "/infra/file/upload?tableName=" + tableName + "&tableId=" + tableId,
filePath: filePath, filePath: filePath,

Loading…
Cancel
Save