diff --git a/.env b/.env new file mode 100644 index 0000000..d121dce --- /dev/null +++ b/.env @@ -0,0 +1,6 @@ +# .env.development +# VITE_API_URL=http://localhost:3000/api + +# # .env.production +# VITE_API_URL=https://api.yourdomain.com + diff --git a/package.json b/package.json index 4440feb..231cce1 100644 --- a/package.json +++ b/package.json @@ -53,15 +53,12 @@ "@dcloudio/uni-mp-xhs": "3.0.0-4060520250512001", "@dcloudio/uni-quickapp-webview": "3.0.0-4060520250512001", "@dcloudio/uni-ui": "^1.5.7", - "axios": "^1.9.0", - "axios-miniprogram-adapter": "^0.3.5", "echarts": "^5.6.0", "pinia": "^3.0.2", "pinia-plugin-unistorage": "^0.1.2", - "sass": "^1.89.0", - "sass-loader": "^16.0.5", - "vue": "^3.4.21", - "vue-i18n": "^9.1.9" + "sass": "1.63.2", + "sass-loader": "10.4.1", + "vue": "^3.4.21" }, "devDependencies": { "@dcloudio/types": "^3.4.8", diff --git a/src/App.vue b/src/App.vue index 33e4b64..de2b297 100644 --- a/src/App.vue +++ b/src/App.vue @@ -2,7 +2,7 @@ * @Author: XHC * @Date: 2025-05-19 10:21:48 * @LastEditors: XHC - * @LastEditTime: 2025-05-26 16:34:09 + * @LastEditTime: 2025-05-30 10:44:11 * @Description: --> diff --git a/src/http/http.js b/src/http/http.js new file mode 100644 index 0000000..70bfb5c --- /dev/null +++ b/src/http/http.js @@ -0,0 +1,43 @@ +/* + * @Author: XHC + * @Date: 2025-05-19 10:42:57 + * @LastEditors: XHC + * @LastEditTime: 2025-05-28 14:00:10 + * @Description: + */ +let baseUrl +// 针对 H5 环境 +// #ifdef H5 + baseUrl = "/bht" +// #endif +// 针对 App 或小程序 +// #ifdef APP-PLUS || MP + baseUrl = "http://192.168.2.67:9652" +// #endif + +export const http = function (url, method = 'get', data = {}) { + return new Promise((resolve, reject) => { + uni.request({ + url: baseUrl + url, + data, + method, + header: { + 'token': uni.getStorageSync('token') || '', + }, // 自定义请求头 + success: res => { // 成功的回调 + // if (res.data.code == 401) { + // uni.reLaunch({ + // url: "/pages/login/login" + // }); + // } + resolve(res.data); + }, + fail: (err) => { // 失败的回调 + reject(err); + }, + complete: () => { // 不论成功失败的回调 + // 可以在这里写一些通用的逻辑,比如隐藏加载动画 + } + }); + }); +}; \ No newline at end of file diff --git a/src/pages.json b/src/pages.json index 14e0815..c862927 100644 --- a/src/pages.json +++ b/src/pages.json @@ -39,12 +39,6 @@ "navigationBarTitleText": "开始巡检" } }, - { - "path": "pages/scanCode/scanCode", - "style": { - "navigationBarTitleText": "扫描二维码" - } - }, { "path": "pages/feedback/feedback", "style": { @@ -56,6 +50,12 @@ "style": { "navigationBarTitleText": "巡查统计" } + }, + { + "path": "pages/points/points", + "style": { + "navigationBarTitleText": "巡检点位" + } } ], "globalStyle": { diff --git a/src/pages/feedback/feedback.vue b/src/pages/feedback/feedback.vue index 1675cd0..3f187b2 100644 --- a/src/pages/feedback/feedback.vue +++ b/src/pages/feedback/feedback.vue @@ -2,7 +2,7 @@ * @Author: XHC * @Date: 2025-05-26 11:59:36 * @LastEditors: XHC - * @LastEditTime: 2025-05-26 15:52:32 + * @LastEditTime: 2025-05-29 14:03:25 * @Description: 系统反馈 -->