完成抽奖页面,结果页面事件逻辑,待给到设计稿更新页面
This commit is contained in:
@@ -1,14 +1,16 @@
|
||||
import axios from 'axios'
|
||||
import QS from 'qs';
|
||||
import { Toast } from 'vant'
|
||||
|
||||
|
||||
let url = import.meta.env.VITE_HOST + import.meta.env.VITE_API
|
||||
|
||||
// 创建axios
|
||||
const service = axios.create({
|
||||
baseURL: import.meta.env.VITE_API,
|
||||
baseURL: url,
|
||||
timeout: 50000,
|
||||
});
|
||||
|
||||
|
||||
|
||||
// 添加请求拦截器
|
||||
service.interceptors.request.use((config) => {
|
||||
// 在发送请求之前做些什么
|
||||
@@ -22,11 +24,10 @@ service.interceptors.request.use((config) => {
|
||||
// 添加响应拦截器
|
||||
service.interceptors.response.use(
|
||||
(response) => {
|
||||
|
||||
return response.data;
|
||||
return response.data || {};
|
||||
}, (error) => {
|
||||
|
||||
|
||||
Toast('网络繁忙')
|
||||
console.log('请求错误:', error.message);
|
||||
return Promise.reject(error);
|
||||
});
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import http from './http'
|
||||
|
||||
export function addSurveyed(data, authorization) {
|
||||
export function drawApi(data, authorization) {
|
||||
return http.post("/api/user/addSurveyed",
|
||||
data,
|
||||
true,
|
||||
|
||||
Reference in New Issue
Block a user