|
@@ -2,8 +2,8 @@
|
|
* @Author: fxs bjnsfxs@163.com
|
|
* @Author: fxs bjnsfxs@163.com
|
|
* @Date: 2024-08-20 17:24:06
|
|
* @Date: 2024-08-20 17:24:06
|
|
* @LastEditors: fxs bjnsfxs@163.com
|
|
* @LastEditors: fxs bjnsfxs@163.com
|
|
- * @LastEditTime: 2024-10-10 12:08:47
|
|
|
|
- * @FilePath: \Game-Backstage-Management-System\src\hooks\useRequest.ts
|
|
|
|
|
|
+ * @LastEditTime: 2024-10-17 09:26:16
|
|
|
|
+ * @FilePath: \Quantity-Creation-Management-Systemc:\Users\NINGMEI\Desktop\Game-Backstage-Management-System\src\hooks\useRequest.ts
|
|
* @Description:
|
|
* @Description:
|
|
*
|
|
*
|
|
*/
|
|
*/
|
|
@@ -13,17 +13,18 @@ import type { ResponseInfo } from '@/types/res'
|
|
|
|
|
|
import { ElMessage } from 'element-plus'
|
|
import { ElMessage } from 'element-plus'
|
|
import { MessageType } from '@/types/res'
|
|
import { MessageType } from '@/types/res'
|
|
|
|
+import BASE_URL from '../../config/api'
|
|
|
|
|
|
import 'element-plus/theme-chalk/el-message.css'
|
|
import 'element-plus/theme-chalk/el-message.css'
|
|
import 'element-plus/theme-chalk/el-message-box.css'
|
|
import 'element-plus/theme-chalk/el-message-box.css'
|
|
|
|
|
|
export function useRequest() {
|
|
export function useRequest() {
|
|
- let baseURL = ''
|
|
|
|
- if (import.meta.env.MODE === 'development') {
|
|
|
|
- baseURL = 'http://server.ichunhao.cn'
|
|
|
|
- } else {
|
|
|
|
- baseURL = 'http://service.ichunhao.cn'
|
|
|
|
- }
|
|
|
|
|
|
+ let baseURL = BASE_URL
|
|
|
|
+ // if (import.meta.env.MODE === 'test') {
|
|
|
|
+ // baseURL = import.meta.env.VITE_API_URL_TEST
|
|
|
|
+ // } else {
|
|
|
|
+ // baseURL = import.meta.env.VITE_API_URL_PRODUCT
|
|
|
|
+ // }
|
|
|
|
|
|
const AllApi = {
|
|
const AllApi = {
|
|
// mock: `http://127.0.0.1:8003/mock`,
|
|
// mock: `http://127.0.0.1:8003/mock`,
|