feat(api): 新增问卷设计相关接口并优化问卷创建流程

- 新增问卷设计相关接口: snQuestions, saveQuestion, sync, questionDetails
- 实现问卷创建功能,包括生成问卷模板和保存问卷标题、介绍等信息
-优化内容可编辑组件,增加失焦时保存内容的功能
- 更新环境变量和代理配置,以适应新的后端接口地址
This commit is contained in:
陈昱达
2025-03-11 16:21:47 +08:00
parent fe56872f72
commit 2c6f86bfc6
12 changed files with 222 additions and 264 deletions

View File

@@ -4,13 +4,9 @@ import axios from 'axios';
// import { A_COMMON_CLEAR_TOKEN } from '@/stores/constance/constance.common.js';
import * as config from '@/config.js';
console.log(config.default);
// import {proxyUrl} from config.default
//
const NODE_ENV = import.meta.env.VITE_APP_ENV;
const baseURL = NODE_ENV === 'production' ? config.default.proxyUrl : '/backend-api';
const baseURL = NODE_ENV === 'production' ? config.default.proxyUrl : 'http://192.168.8.165:15011/';
// axios.defaults.withCredentials = true;
@@ -31,7 +27,8 @@ service.interceptors.request.use(
if (!config.headers.remoteIp) {
config.baseURL += '/api';
}
// config.headers.remoteIp = localStorage.getItem('plantIp') || '127.0.0.1';
delete config.headers.host;
config.headers.remoteIp = localStorage.getItem('plantIp') || '127.0.0.1';
// if (store.state.common.token) {
// config.headers['Login-Type'] = 'pc';
// config.headers.Authorization = `Bearer ${store.state.common.token}`;
@@ -45,10 +42,10 @@ service.interceptors.request.use(
service.interceptors.response.use(
(response) => {
if (
response.status === 200 ||
response.status === 201 ||
response.status === 202 ||
response.status === 204
response.status === 200
|| response.status === 201
|| response.status === 202
|| response.status === 204
) {
if (response.config.method === 'put') {
// message.success('保存中...');