From b372a20e03ba5e49f4937a686df260aa962c1605 Mon Sep 17 00:00:00 2001 From: ChuShiZ Date: Thu, 19 Sep 2024 19:55:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E7=89=87=E5=9C=B0=E5=9D=80=E6=8B=BC?= =?UTF-8?q?=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/login.js | 4 +- config.js | 8 ++-- main.js | 4 +- pages/details/details.vue | 12 ++--- pages/details/map.vue | 7 +-- pages/details/mapDetails.vue | 11 +++-- pages/login/login.vue | 89 ++++++++++++++++++++---------------- pages/my/carManage.vue | 5 +- pages/my/carManageForm.vue | 18 ++++---- pages/my/my.vue | 11 +++-- pages/rescue/initiate.vue | 8 ++-- pages/rescue/order.vue | 5 +- 12 files changed, 102 insertions(+), 80 deletions(-) diff --git a/api/login.js b/api/login.js index edb5040..cb8b808 100644 --- a/api/login.js +++ b/api/login.js @@ -63,10 +63,10 @@ export function loginApp(data) { // 使用租户域名(标识),获得租户编号 export function getTenantIdByWebsite(website) { return request({ - url: '/system/tenant/get-by-website', + url: '/system/tenant/getListByWebsite', method: 'get', params: { website } }) -} \ No newline at end of file +} diff --git a/config.js b/config.js index b48b109..c0d2aad 100644 --- a/config.js +++ b/config.js @@ -1,10 +1,12 @@ // 应用全局配置 module.exports = { - baseUrl: 'http://localhost:48080/admin-api', + baseUrl: 'http://192.168.31.29:48080/admin-api', + // baseUrl: 'http://47.94.122.58:8011/rescue', // baseUrl: 'http://47.95.206.185:8011/rescue', //baseUrl: 'http://47.95.206.185:8011/rescue', - imagesUrl: 'http://shequ.0315e.com/static/images/pages/', - wsUrl: 'ws://47.95.206.185:8011/rescue', + imagesUrl: 'https://www.nuoyunr.com/minio', + baseImageUrl: 'https://www.nuoyunr.com/minio/', + wsUrl: 'ws://192.168.1.8:48080', // 应用信息 appInfo: { // 应用名称 diff --git a/main.js b/main.js index 175166e..b88786b 100644 --- a/main.js +++ b/main.js @@ -37,6 +37,8 @@ Vue.prototype.$getclearInterval = getclearInterval; const baseUrl = config.baseUrl Vue.prototype.$baseUrl = baseUrl; +const baseImageUrl = config.baseImageUrl +Vue.prototype.$baseImageUrl = baseImageUrl; // #ifndef VUE3 import Vue from 'vue' import './uni.promisify.adaptor' @@ -62,4 +64,4 @@ export function createApp() { app } } -// #endif \ No newline at end of file +// #endif diff --git a/pages/details/details.vue b/pages/details/details.vue index fec447d..ca10f2b 100644 --- a/pages/details/details.vue +++ b/pages/details/details.vue @@ -51,7 +51,7 @@ 待取车 --> - + @@ -141,7 +141,7 @@ - + @@ -164,7 +164,7 @@ - + --> @@ -196,7 +196,7 @@ compass: true, marker: [], urlList: [], - baseUrl: this.$baseUrl, + baseImageUrl: this.$baseImageUrl, detailsinfo: null, timerId: null, currentIndicator: 'none', @@ -254,7 +254,7 @@ }, methods: { previewImage(url) { - let newsurl = this.baseUrl + url + let newsurl = this.baseImageUrl + url this.urlList.push(newsurl) console.log(); uni.previewImage({ @@ -836,4 +836,4 @@ height: 100%; } } - \ No newline at end of file + diff --git a/pages/details/map.vue b/pages/details/map.vue index 7b66f84..e2689cb 100644 --- a/pages/details/map.vue +++ b/pages/details/map.vue @@ -10,7 +10,7 @@ - + {{item.title}} @@ -32,7 +32,7 @@ - + {{item.title}} @@ -67,6 +67,7 @@ scale: 13, //缩放级别 compass: true, marker: [], + baseImageUrl: this.$baseImageUrl } }, onLoad() { @@ -346,4 +347,4 @@ color: #5BA8FF !important; font-weight: bold !important; } - \ No newline at end of file + diff --git a/pages/details/mapDetails.vue b/pages/details/mapDetails.vue index ff982d4..56fbc17 100644 --- a/pages/details/mapDetails.vue +++ b/pages/details/mapDetails.vue @@ -2,7 +2,7 @@ - + @@ -57,7 +57,8 @@ return { id: '', arr: {}, - imgs: '' + imgs: '', + baseImageUrl: this.$baseImageUrl, } }, onLoad(option) { @@ -160,7 +161,7 @@ .biaoq { // width: 136rpx; - + height: 40rpx; background: #E5EEF5; border-radius: 20rpx 20rpx 20rpx 20rpx; @@ -168,7 +169,7 @@ background: #E5EEF5; font-size: 24rpx; font-weight: 400; - + margin: 20rpx 0rpx; padding: 5px 20px; display: inline-block; @@ -274,4 +275,4 @@ height: 44rpx; } } - \ No newline at end of file + diff --git a/pages/login/login.vue b/pages/login/login.vue index edc3a5b..ac314eb 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -122,7 +122,7 @@ yzm: '', wrod: '', activeid: 0, - tenantCode: 'lighting' + tenantCode: 'lanan' } }, computed: { @@ -141,12 +141,6 @@ }, }, mounted(){ - getTenantIdByWebsite(this.tenantCode).then(res => { - const tenantId = res.data; - if (tenantId && tenantId >= 0) { - setTenantId(tenantId) - } - }) }, methods: { @@ -275,41 +269,58 @@ uni.setStorageSync('identity', this.sfindex); - if (this.activeid == 0) { - const data = { - username: this.tel, - password: this.wrod, - type: 0 - } - loginApp(data).then(res => { - setToken(res.data.accessToken) - this.userinfo() - }) - } - if (this.activeid == 1) { - const data = { - phone: this.tel, - code: this.yzm, - type: 1 - } - request({ - url: '/loginApp', - method: 'post', - data: data - }).then((res) => { - console.log('验证码请求', res); - if (res.code == 0) { - uni.showToast({ - title: '登录成功', - icon: 'none' - }) + const loginFun = () => { + if (this.activeid == 0) { + const data = { + username: this.tel, + password: this.wrod, + type: 0 + } + loginApp(data).then(res => { setToken(res.data.accessToken) - this.userinfo() + this.userinfo() + }) + } + if (this.activeid == 1) { + const data = { + phone: this.tel, + code: this.yzm, + type: 1 + } + request({ + url: '/loginApp', + method: 'post', + data: data + }).then((res) => { + console.log('验证码请求', res); + if (res.code == 0) { + uni.showToast({ + title: '登录成功', + icon: 'none' + }) + setToken(res.data.accessToken) + this.userinfo() - } + } - }) - } + }) + } + } + + getTenantIdByWebsite(this.tenantCode).then(res => { + if (res.code === 200 && res.data && res.data.length > 0) { + uni.showActionSheet({ + itemList: res.data.map(m => m.name), + success: ({tapIndex}) => { + setTenantId(res.data[tapIndex].id) + loginFun() + } + }) + } else { + setTenantId('') + loginFun() + } + }) }, userinfo() { if (this.sfindex == 'user') { diff --git a/pages/my/carManage.vue b/pages/my/carManage.vue index dcd1e4c..049542a 100644 --- a/pages/my/carManage.vue +++ b/pages/my/carManage.vue @@ -10,7 +10,7 @@ - + @@ -59,6 +59,7 @@ data() { return { baseUrl: this.$baseUrl, + baseImageUrl: this.$baseImageUrl, carList: [], searchName: null, pageNum: 1, @@ -235,4 +236,4 @@ bottom: 30px; right: 15px; } - \ No newline at end of file + diff --git a/pages/my/carManageForm.vue b/pages/my/carManageForm.vue index a905650..b8f9e7d 100644 --- a/pages/my/carManageForm.vue +++ b/pages/my/carManageForm.vue @@ -72,7 +72,7 @@ 删除 保存 - + @@ -120,7 +120,7 @@ carCheckTime: "", //年检到期时间 carLicenseColor: "", //车牌颜色 carUseNature: "", //使用性质 - frameNumber: "" //车架号 + frameNumber: "" //车架号 }, carUseNature: [], //使用性质列表 jycType: [], //救援车类型 @@ -150,7 +150,7 @@ setTimeout(function() { uni.navigateBack() - }.bind(this), 1000); // 2000毫秒后执行 + }.bind(this), 1000); // 2000毫秒后执行 }) }, // 删除图片 @@ -220,7 +220,7 @@ url: '/common/upload', filePath: res.tempFilePath, }).then((res) => { - this.imageList1.push(res.fileName) + this.imageList1.push(this.$baseImageUrl + res.data.url) console.log(res); }) @@ -239,7 +239,7 @@ url: '/common/upload', filePath: res.tempFilePath, }).then((res) => { - this.imageList2.push(res.fileName) + this.imageList2.push(this.$baseImageUrl + res.data.url) console.log(res); }) @@ -319,7 +319,7 @@ setTimeout(function() { uni.navigateBack() - }.bind(this), 1000); // 2000毫秒后执行 + }.bind(this), 1000); // 2000毫秒后执行 }) } else { console.log(this.carInfo, 'update'); @@ -335,7 +335,7 @@ }) setTimeout(function() { uni.navigateBack() - }.bind(this), 1000); // 2000毫秒后执行 + }.bind(this), 1000); // 2000毫秒后执行 }) } @@ -490,7 +490,7 @@ font-size: 24rpx; } } - + .uploadBtn { width: 120rpx; height: 120rpx; @@ -540,4 +540,4 @@ align-items: center; justify-content: center; } - \ No newline at end of file + diff --git a/pages/my/my.vue b/pages/my/my.vue index d5e8bcc..7410fd5 100644 --- a/pages/my/my.vue +++ b/pages/my/my.vue @@ -14,7 +14,7 @@ :maxCount="1" width="60" height="60"> - + 立即登录 @@ -185,7 +185,8 @@ }, msg: '4', value: '', - baseUrl: this.$baseUrl + baseUrl: this.$baseUrl, + baseImageUrl: this.$baseImageUrl, } }, mounted() { @@ -227,7 +228,7 @@ async getUserinfo() { await request({ - url: '/getAppInfo', + url: '/rescue/getJcAppInfo', method: 'get', }).then((res) => { if (res.code == 200) { @@ -282,7 +283,7 @@ }).then((res) => { console.log(res.fileName); - this.onChooseavatar(res.fileName) + this.onChooseavatar(this.$baseImageUrl + res.data.url) // this.releasebox.imageList.push(res.fileName) // console.log(this.releasebox.imageList); }) @@ -360,7 +361,7 @@ return } let res = await request({ - url: '/getAppInfo', + url: '/rescue/getJcAppInfo', method: 'get', }) console.log('个人信息', res); diff --git a/pages/rescue/initiate.vue b/pages/rescue/initiate.vue index 89c84d5..c01b3fa 100644 --- a/pages/rescue/initiate.vue +++ b/pages/rescue/initiate.vue @@ -285,7 +285,7 @@ this.car = res.data console.log(res); }) - + request({ url: '/rescue/dict/data/type/kcRescueRoad-1', method: 'get' @@ -461,7 +461,9 @@ url: '/common/upload', filePath: res.tempFilePath, }).then((res) => { - this.imageList.push(res.fileName) + console.log('res.fileName', res.data.url) + this.imageList.push(this.$baseImageUrl + res.data.url) + console.log('this.imageList', this.imageList) console.log(res); }) @@ -777,4 +779,4 @@ background: #327DFB; border-radius: 12rpx; } - \ No newline at end of file + diff --git a/pages/rescue/order.vue b/pages/rescue/order.vue index 641b3a0..5a97e9c 100644 --- a/pages/rescue/order.vue +++ b/pages/rescue/order.vue @@ -57,7 +57,8 @@ label: '扣车', icon: require('@/static/icons/order/tuoche.png') }, - ] + ], + baseImageUrl: this.$baseImageUrl, } }, components: { @@ -234,4 +235,4 @@ // #y5 { // background-image: url('../../static/kc.png'); // } - \ No newline at end of file +