From 96a53ff3c696cd2fe9bcabcf65def94f2b566357 Mon Sep 17 00:00:00 2001 From: caill <815519168@qq.com> Date: Mon, 18 Mar 2024 15:14:55 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/login/login.vue | 32 ++++++++++++++-------------- pages/login/setup.vue | 14 +++++++++++- pages/manage/group-in-storage.vue | 1 + pages/manage/out-storage-confirm.vue | 4 ++-- utils/getData2.js | 2 ++ utils/mork2.js | 16 ++++++++++++++ utils/request.js | 17 +++++---------- vuex/modules/user.js | 5 +++++ 8 files changed, 60 insertions(+), 31 deletions(-) diff --git a/pages/login/login.vue b/pages/login/login.vue index 28ef858..8173f0f 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -9,13 +9,13 @@ - - - - 记住用户名 + + + - 设置 - 升级版本 + 记住用户名 + 设置 + 升级版本 v{{version}} @@ -131,7 +131,7 @@ _font(40rpx,75rpx,#444,666) padding-top: 190rpx .p2 - _font(46rpx,1,#444,600) + _font(44rpx,1,#444,600) padding: 10rpx 0 55rpx 0 .input-box _fj() @@ -143,19 +143,19 @@ _font(32rpx,74rpx,#999) padding-left 10rpx .radio-box - _fj() - margin: 25rpx 0 70rpx 0 - height: 34rpx -.radio-wrap - _fj(flex-start) - height: 34rpx - flex: 2 + margin 25rpx 0 70rpx 0 +.radio-icon-wrap + _wh(34rpx, 34rpx) + border 1rpx solid #999 + border-radius 4rpx + text-align center + line-height 40rpx +.radio-icon-wrap_checked + border-color $red .radio-label _font(28rpx, 28rpx,#333) - padding-left: 10rpx .setup-text _font(28rpx, 28rpx,$red,,right) - padding-left 25rpx .bg background-color: #fff; _bis('../../static/image/login_bg.png', 100%,,bottom) diff --git a/pages/login/setup.vue b/pages/login/setup.vue index 22c2b0e..0d144ef 100644 --- a/pages/login/setup.vue +++ b/pages/login/setup.vue @@ -7,6 +7,10 @@ 服务器地址 + + ACS地址 + + 打印地址 @@ -32,6 +36,7 @@ data() { return { addrip: this.$store.getters.baseUrl, + acsip: this.$store.getters.acsUrl, printip: this.$store.getters.printUrl, setTime: this.$store.getters.setTime / 1000 }; @@ -50,6 +55,13 @@ }) return } + if (this.acsip === '') { + uni.showToast({ + title: '请填写ACS地址', + icon: 'none' + }) + return + } if (this.printip === '') { uni.showToast({ title: '请填写打印地址', @@ -65,7 +77,7 @@ return } // 存值 - this.$store.dispatch('setConfig',{baseUrl: this.addrip, printUrl: this.printip,setTime: this.setTime * 1000}) + this.$store.dispatch('setConfig',{baseUrl: this.addrip, acsUrl: this.acsip, printUrl: this.printip,setTime: this.setTime * 1000}) uni.redirectTo({ url: '/pages/login/login' }) diff --git a/pages/manage/group-in-storage.vue b/pages/manage/group-in-storage.vue index 812eac1..420d538 100644 --- a/pages/manage/group-in-storage.vue +++ b/pages/manage/group-in-storage.vue @@ -264,6 +264,7 @@ title: res.message, icon: 'none' }) + this._queryExistGroup() } catch (e) { this.disabled2 = false } diff --git a/pages/manage/out-storage-confirm.vue b/pages/manage/out-storage-confirm.vue index a1100d0..9c2187a 100644 --- a/pages/manage/out-storage-confirm.vue +++ b/pages/manage/out-storage-confirm.vue @@ -76,8 +76,8 @@ - - + + diff --git a/utils/getData2.js b/utils/getData2.js index 9a9729e..2ab03b8 100644 --- a/utils/getData2.js +++ b/utils/getData2.js @@ -185,6 +185,7 @@ export const taskConfirm = (code1, code2) => request({ // 查询未完成指令 export const pdaInsts = (keyword, scode, ncode) => request({ url:'api/pda/insts', + acsurl: true, data: { keyword: keyword, start_devicecode: scode, @@ -195,6 +196,7 @@ export const pdaInsts = (keyword, scode, ncode) => request({ // 指令操作 export const pdaInst = (type, uuid) => request({ url:'api/pda/inst', + acsurl: true, data: { type: type, inst_uuid: uuid diff --git a/utils/mork2.js b/utils/mork2.js index c624b4a..e8259aa 100644 --- a/utils/mork2.js +++ b/utils/mork2.js @@ -1,3 +1,12 @@ +export const handLogin = (user, password) => { + let res = { + user: { + user: {username: 'admin'}, + }, + token: 'abcd' + } + return res +} export const getVehicleType = () => { let res = [ { @@ -63,6 +72,13 @@ export const queryVehicleGroup = () => { return res } +export const groupLink = (arr) => { + let res = { + "message": "tempor elit adipisicing cillum nisi" + } + return res +} + export const pdaPrintf = (code) => { let res = { "vehicle_code": "91", diff --git a/utils/request.js b/utils/request.js index 015aca8..92beec6 100644 --- a/utils/request.js +++ b/utils/request.js @@ -5,17 +5,7 @@ const request = (params) => { let url = params.url; let method = params.method || 'POST'; let data = params.data || {}; - // data.token = "default-access_token" - // if (!params.token) { - // let token = uni.getStorageSync('token'); - // if (!token) { - // uni.navigateTo({ - // url: '/pages/login/login' - // }); - // } else { - // data.token = '179509245-9c91827e0224bdc18d0b118b8be1b5af'; - // } - // } + let acsurl = params.acsurl let token = '' if (store.getters.saveToken !== '') { token = store.getters.saveToken @@ -34,7 +24,10 @@ const request = (params) => { } // data = qs.stringify(data) } - const requestUrl = `${store.getters.baseUrl}/` + url; + let requestUrl = `${store.getters.baseUrl}/` + url; + if (acsurl) { + requestUrl = `${store.getters.acsUrl}/` + url; + } uni.showLoading({ title: '加载中...' }); diff --git a/vuex/modules/user.js b/vuex/modules/user.js index 5d4c4d0..f5a508f 100644 --- a/vuex/modules/user.js +++ b/vuex/modules/user.js @@ -1,9 +1,11 @@ import * as types from '../types' const baseUrl = process.env.NODE_ENV === 'development' ? 'http://10.1.3.90:8010' : 'http://10.1.3.90:8010' +const acsUrl = process.env.NODE_ENV === 'development' ? 'http://10.1.3.90:8010' : 'http://10.1.3.90:8010' const printUrl = process.env.NODE_ENV === 'development' ? 'http://10.1.3.90:8010' : 'http://10.1.3.90:8010' const state = { baseUrl: uni.getStorageSync('baseUrl') || baseUrl, + acsUrl: uni.getStorageSync('acsUrl') || acsUrl, printUrl: uni.getStorageSync('printUrl') || printUrl, setTime: uni.getStorageSync('setTime') || 5000, loginName: uni.getStorageSync('loginName') ? uni.getStorageSync('loginName') : '', @@ -12,6 +14,7 @@ const state = { } const getters = { baseUrl: state => state.baseUrl, + acsUrl: state => state.acsUrl, printUrl: state => state.printUrl, setTime: state => state.setTime, loginName: state => state.loginName, @@ -21,6 +24,7 @@ const getters = { const actions = { setConfig ({commit}, res) { uni.setStorageSync('baseUrl', res.baseUrl) + uni.setStorageSync('acsUrl', res.acsUrl) uni.setStorageSync('printUrl', res.printUrl) uni.setStorageSync('setTime', res.setTime) commit(types.COM_CONFIG, res) @@ -50,6 +54,7 @@ const actions = { const mutations = { [types.COM_CONFIG] (state, res) { state.baseUrl = res.baseUrl + state.acsUrl = res.acsUrl state.printUrl = res.printUrl state.setTime = res.setTime },