|
|
@@ -7,15 +7,15 @@ import axios, {
|
|
|
FormData,
|
|
|
InternalAxiosRequestConfig
|
|
|
} from '@ohos/axios';
|
|
|
-import { ContextHelper, IBestToast, ReqString, YTLog } from '../../../../Index';
|
|
|
+import { ContextHelper, IBestToast, ReqString, YTLog, ytOaidUtils } from '../../../../Index';
|
|
|
import { AppStorageKeyCollect } from '../constants';
|
|
|
import { userInfo } from '../models/UserInfo';
|
|
|
import { yTRouter } from '../utils/arkts/utils/YTRouter';
|
|
|
|
|
|
|
|
|
-export const baseURL: string = 'https://hm.ytpm.net/prod-activity'
|
|
|
+export const baseURL: string = 'https://hm-test.ytpm.net/prod-military'
|
|
|
|
|
|
-// export const baseURL: string = 'http://192.168.1.160:48103'
|
|
|
+// export const baseURL: string = 'http://192.168.1.20:25017'
|
|
|
|
|
|
export const instance = axios.create({
|
|
|
baseURL,
|
|
|
@@ -23,23 +23,23 @@ export const instance = axios.create({
|
|
|
})
|
|
|
|
|
|
// 添加请求拦截器
|
|
|
-instance.interceptors.request.use((config: InternalAxiosRequestConfig) => {
|
|
|
+instance.interceptors.request.use(async (config: InternalAxiosRequestConfig) => {
|
|
|
|
|
|
// 对请求数据做点什么 - 为请求参数添加 token
|
|
|
- if (AppStorage.get<string>(AppStorageKeyCollect.TOKEN)) {
|
|
|
- config.headers.Authorization = AppStorage.get<string>(AppStorageKeyCollect.TOKEN)
|
|
|
- }
|
|
|
+ // if (AppStorage.get<string>(AppStorageKeyCollect.TOKEN)) {
|
|
|
+ // config.headers.Authorization = AppStorage.get<string>(AppStorageKeyCollect.TOKEN)
|
|
|
+ // }
|
|
|
|
|
|
// 为请求参数添加 oaid
|
|
|
- if ((config.method == 'get' || config.method == 'delete') && config.url) {
|
|
|
- // if(config?.params) {
|
|
|
- // config.params.oaid = await ytOaidUtils.getOaid()
|
|
|
- // }
|
|
|
- } else {
|
|
|
- // if(config?.data) {
|
|
|
- // config.data.oaid = await ytOaidUtils.getOaid()
|
|
|
- // }
|
|
|
- }
|
|
|
+ // if ((config.method == 'get' || config.method == 'delete') && config.url) {
|
|
|
+ // if(config?.params) {
|
|
|
+ // config.params.oaid = await ytOaidUtils.getOaid()
|
|
|
+ // }
|
|
|
+ // } else {
|
|
|
+ // if(config?.data) {
|
|
|
+ // config.data.oaid = await ytOaidUtils.getOaid()
|
|
|
+ // }
|
|
|
+ // }
|
|
|
|
|
|
|
|
|
YTLog.info(config.data, '请求参数')
|