明树Git Lab

Commit 43d73b63 authored by yangyajing's avatar yangyajing

项目管理数据对接

parent cd2cfd16
Pipeline #104032 failed with stage
in 2 seconds
import axios from "axios";
import { ElMessage } from "element-plus";
import windowConfig from "@/window";
axios.interceptors.request.use(function (config) {
let token = "8681f75e775447f7903708c55a35634e";
if (token) {
......@@ -23,12 +24,11 @@ axios.interceptors.response.use(response => {
}
return Promise.reject(err);
});
let baseUrl = "http://10.40.8.9:3000"
export function $get ({ url, params = {}, callback }) {
return axios({
method: "get",
url: baseUrl + url,
url: windowConfig.baseUrl + url,
params
}).then(response => {
callback && callback(response.data);
......@@ -39,7 +39,7 @@ export function $get ({ url, params = {}, callback }) {
};
export function $post ({ url, data = {}, callback }) {
return axios.post(baseUrl + url, data).then((response) => {
return axios.post(windowConfig.baseUrl + url, data).then((response) => {
if (response.code === 0) {
callback && callback(response.data);
} else {
......
......@@ -9,11 +9,13 @@ import { createPinia } from 'pinia';
import "./assets/fonts/font.less"; // 字体样式
import "../public/iconFont/iconfont.css"; // 图标字体样式
import { $get, $post } from "@/data/https.js";
import windowConfig from "@/window";
const pinia = createPinia()
const app = createApp(App)
app.config.globalProperties.$get = $get;
app.config.globalProperties.$post = $post;
app.config.globalProperties.windowConfig = windowConfig;
for (const [key, component] of Object.entries(ElIcons)) {
app.component(key, component)
}
......
This diff is collapsed.
export default {
baseUrl: "http://10.40.8.9:3000"
};
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment