已调通微信小程序,支持域名调用

This commit is contained in:
ZLI263
2025-11-23 20:03:56 +08:00
parent 7a7ffbfd0c
commit 78d8db3c68
4 changed files with 26 additions and 71 deletions

View File

@@ -8,6 +8,9 @@
"h5" : {
"launchtype" : "local"
},
"mp-weixin" : {
"launchtype" : "local"
},
"provider" : "alipay",
"type" : "uniCloud"
}

View File

@@ -50,15 +50,15 @@
"port" : 8080,
"proxy" : {
"^/api" : {
"target" : "http://localhost:9060",
"target" : "https://api.huayang-star.com",
"changeOrigin" : true,
"secure" : false
"secure" : true
}
}
}
},
"mp-weixin" : {
"appid" : "",
"appid" : "wx534c58a9db510fba",
"setting" : {
"urlCheck" : false
},

View File

@@ -78,10 +78,9 @@
<view class="banner-icon">
<uni-icons type="loop" size="18" color="#007AFF"></uni-icons>
</view>
<text class="banner-text">AI总结提炼关键, 为销售减负</text>
</view>
<text class="banner-right">样板间</text>
<text class="banner-text">AI总结提炼关键, 为销售减负</text>
</view>
</view>
<!-- 音频播放器 -->
<view class="audio-player">
@@ -259,7 +258,6 @@
</view>
<text class="banner-text">AI总结提炼关键,为销售减负</text>
</view>
<text class="banner-right">样板间</text>
</view>
<!-- 音频播放器如果有 -->
<view class="performance-audio" v-if="category.showAudio">
@@ -428,6 +426,7 @@
import ServiceList from './components/ServiceList.vue';
import CustomerProfileModal from './components/CustomerProfileModal.vue';
import { initCustomerProfile, initSummaryList, initPerformanceData } from './utils/dataInit.js';
import { API_BASE_URL } from '@/common/config.js';
export default {
// #ifdef APP
@@ -649,22 +648,13 @@
return;
}
// H5环境下使用代理路径其他环境使用完整URL
let url;
// #ifdef H5
url = `/api/audioTextAnalysisFurniture/byParentId?parentId=${parentId}`;
// #endif
// #ifndef H5
url = `http://localhost:9060/api/audioTextAnalysisFurniture/byParentId?parentId=${parentId}`;
// #endif
// 统一使用完整URL
const url = `${API_BASE_URL}api/audioTextAnalysisFurniture/byParentId?parentId=${parentId}`;
const res = await uni.request({
url: url,
method: 'GET',
timeout: 10000,
header: {
'Content-Type': 'application/json'
}
timeout: 10000
});
if (res.statusCode === 200 && res.data && res.data.success) {
@@ -1090,22 +1080,13 @@
.map(key => `${key}=${encodeURIComponent(queryParams[key])}`)
.join('&');
// H5环境下使用代理路径其他环境使用完整URL
let url;
// #ifdef H5
url = `/api/todoItem/list?${queryString}`;
// #endif
// #ifndef H5
url = `http://localhost:9060/api/todoItem/list?${queryString}`;
// #endif
// 统一使用完整URL
const url = `${API_BASE_URL}api/todoItem/list?${queryString}`;
const res = await uni.request({
url: url,
method: 'GET',
timeout: 10000,
header: {
'Content-Type': 'application/json'
}
timeout: 10000
});
if (res.statusCode === 200 && res.data && res.data.success) {
@@ -1237,14 +1218,8 @@
}
try {
// H5环境下使用代理路径其他环境使用完整URL
let url;
// #ifdef H5
url = `/api/todoItem/updateTodoStatus`;
// #endif
// #ifndef H5
url = `http://localhost:9060/api/todoItem/updateTodoStatus`;
// #endif
// 统一使用完整URL
const url = `${API_BASE_URL}api/todoItem/updateTodoStatus`;
const res = await uni.request({
url: url,
@@ -1300,7 +1275,7 @@
url = `/api/todoItem/delayProcessTodo`;
// #endif
// #ifndef H5
url = `http://localhost:9060/api/todoItem/delayProcessTodo`;
url = `${API_BASE_URL}api/todoItem/delayProcessTodo`;
// #endif
const res = await uni.request({
@@ -1351,22 +1326,13 @@
return;
}
// H5环境下使用代理路径其他环境使用完整URL
let url;
// #ifdef H5
url = `/api/audioTextAnalysisFurniture/byParentId?parentId=${parentId}`;
// #endif
// #ifndef H5
url = `http://localhost:8080/api/audioTextAnalysisFurniture/byParentId?parentId=${parentId}`;
// #endif
// 统一使用域名服务器地址
const url = `${API_BASE_URL}api/audioTextAnalysisFurniture/byParentId?parentId=${parentId}`;
const res = await uni.request({
url: url,
method: 'GET',
timeout: 10000,
header: {
'Content-Type': 'application/json'
}
timeout: 10000
});
if (res.statusCode === 200 && res.data && res.data.success) {
@@ -1461,16 +1427,13 @@
url = `/api/audioTextAnalysisSop/listByParentId?parentId=${parentId}`;
// #endif
// #ifndef H5
url = `http://localhost:9060/api/audioTextAnalysisSop/listByParentId?parentId=${parentId}`;
url = `${API_BASE_URL}api/audioTextAnalysisSop/listByParentId?parentId=${parentId}`;
// #endif
const res = await uni.request({
url: url,
method: 'GET',
timeout: 10000,
header: {
'Content-Type': 'application/json'
}
timeout: 10000
});
if (res.statusCode === 200 && res.data && res.data.success) {
@@ -1682,23 +1645,13 @@
.map(key => `${key}=${encodeURIComponent(queryParams[key])}`)
.join('&');
// H5环境下使用代理路径其他环境使用完整URL
let url;
// #ifdef H5
// 使用代理路径会被manifest.json中的proxy配置转发
url = `/api/audioManagement/list?${queryString}`;
// #endif
// #ifndef H5
url = `http://localhost:9060/api/audioManagement/list?${queryString}`;
// #endif
// 统一使用域名服务器地址
const url = `${API_BASE_URL}api/audioManagement/list?${queryString}`;
const res = await uni.request({
url: url,
method: 'GET',
timeout: 10000,
header: {
'Content-Type': 'application/json'
}
timeout: 10000
});
if (res.statusCode === 200 && res.data && res.data.success) {

View File

@@ -19,7 +19,6 @@
<!-- AI功能横幅 -->
<view class="ai-banner">
<text class="banner-text">AI让销售过程和团队管理更透明</text>
<text class="banner-btn">样板间</text>
</view>
<!-- 标签页 -->