From 54a7df532e4fd82a1462edd4475403ed9b2be0cc Mon Sep 17 00:00:00 2001 From: wanshenmean <cathay_xy@163.com> Date: 星期四, 10 四月 2025 14:20:40 +0800 Subject: [PATCH] 添加接口地址更改 --- 代码管理/NEWCode/WIDESEAWCS_PDA/pages/叫料/负极叫料.vue | 9 +- 代码管理/NEWCode/WIDESEAWCS_PDA/pages/login/login.vue | 56 ++++++++++++------ 代码管理/NEWCode/WIDESEAWCS_PDA/pages/叫料/正极叫料.vue | 44 +++++++++----- 代码管理/NEWCode/WIDESEAWCS_PDA/uview-ui/libs/request/index.js | 2 代码管理/NEWCode/WIDESEAWCS_PDA/common/http.interceptor.js | 49 ++++++++++----- 代码管理/NEWCode/WIDESEAWCS_PDA/pages/SetAddress/SetAddress.vue | 13 +++- 代码管理/NEWCode/WIDESEAWCS_Server/WIDESEAWCS_Server/WIDESEAWCS.xml | 7 ++ 7 files changed, 119 insertions(+), 61 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/NEWCode/WIDESEAWCS_PDA/common/http.interceptor.js" "b/\344\273\243\347\240\201\347\256\241\347\220\206/NEWCode/WIDESEAWCS_PDA/common/http.interceptor.js" index 9b5c711..5f5376b 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/NEWCode/WIDESEAWCS_PDA/common/http.interceptor.js" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/NEWCode/WIDESEAWCS_PDA/common/http.interceptor.js" @@ -1,9 +1,10 @@ -let baseUrl = 'http://192.168.0.191:9291' +let baseUrl = '' +const value = uni.getStorageSync('storage_key_ipAddress'); const install = (Vue, vm) => { - + let resolvedBaseUrl = baseUrl === '' ? (value && value.WCSIP ? value.WCSIP : "") : baseUrl; // 姝や负鑷畾涔夐厤缃弬鏁帮紝鍏蜂綋鍙傛暟瑙佷笂鏂硅鏄� Vue.prototype.$u.http.setConfig({ - baseUrl: baseUrl, + baseUrl: resolvedBaseUrl, loadingText: '鍔姏鍔犺浇涓瓇', loadingTime: 5000, originalData: true, @@ -13,21 +14,35 @@ // 璇锋眰鎷︽埅锛岄厤缃甌oken绛夊弬鏁� Vue.prototype.$u.http.interceptor.request = (config) => { // 鍒ゆ柇鏄惁涓哄畬鏁� URL锛屽鏋滄槸鍒欎笉浣跨敤 baseUrl - if (config.url.includes('http://') || config.url.includes('https://')) { - config.baseURL = ''; + if (resolvedBaseUrl === '') { + if (config.url.includes('http://') || config.url.includes('https://')) { + config.baseURL = ''; + resolve(config); + } else { + const storedValue = uni.getStorageSync('storage_key_ipAddress'); + if (storedValue && storedValue.WCSIP) { + config.baseURL = storedValue.WCSIP; + baseUrl = storedValue.WCSIP; + } else { + vm.$u.toast('璇峰厛娣诲姞鍚庡彴IP鍦板潃'); + return false; // 鍙栨秷鏈璇锋眰 + } + // uni.getStorage({ + // key: 'storage_key_ipAddress', + // success: (res) => { + // debugger; + // console.log(res.data.WCSIP); + // config.baseURL = res.data.WCSIP; + // baseUrl = res.data.WCSIP + // }, + // fail: (err) => { + // debugger; + // vm.$u.toast('璇峰厛娣诲姞鍚庡彴IP鍦板潃'); + // }, + // }); + } } else { - uni.getStorage({ - key: 'storage_key_ipAddress', - success: (res) => { - debugger; - console.log(res.data.WCSIP); - config.baseURL = res.data.WCSIP; - }, - fail: (err) => { - console.log("娌℃湁鎵惧埌瀛樺偍鐨処P鍦板潃,浣跨敤榛樿BaseURL") - config.baseURL = baseUrl; - }, - }); + config.baseURL = resolvedBaseUrl; } config.header.Token = 'xxxxxx'; diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/NEWCode/WIDESEAWCS_PDA/pages/SetAddress/SetAddress.vue" "b/\344\273\243\347\240\201\347\256\241\347\220\206/NEWCode/WIDESEAWCS_PDA/pages/SetAddress/SetAddress.vue" index 15ca763..312373d 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/NEWCode/WIDESEAWCS_PDA/pages/SetAddress/SetAddress.vue" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/NEWCode/WIDESEAWCS_PDA/pages/SetAddress/SetAddress.vue" @@ -82,6 +82,11 @@ methods: { submit() { this.$refs.uForm.validate().then(res => { + debugger; + if (!res) { + this.$t.message.toast('楠岃瘉涓嶉�氳繃'); + return false; + } const ipAddress = { WCSIP: this.valiFormData.WCSIP, CZZJip: this.valiFormData.CZZJip, @@ -91,10 +96,12 @@ key: 'storage_key_ipAddress', data: ipAddress, success: (res) => { + // 鍦ㄩ渶瑕佸埛鏂伴〉闈㈢殑鍦版柟璋冪敤 + location.reload(); this.$t.message.toast('淇濆瓨鎴愬姛'); - uni.switchTab({ - url: '/pages/index/index' - }) + uni.navigateBack({ + delta: 1 + }); } }); }).catch(errors => { diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/NEWCode/WIDESEAWCS_PDA/pages/login/login.vue" "b/\344\273\243\347\240\201\347\256\241\347\220\206/NEWCode/WIDESEAWCS_PDA/pages/login/login.vue" index c93ff55..0be57d2 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/NEWCode/WIDESEAWCS_PDA/pages/login/login.vue" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/NEWCode/WIDESEAWCS_PDA/pages/login/login.vue" @@ -1,8 +1,12 @@ <template> <view class="login"> + <view class="tools"> + <uni-icons size="48rpx" color="#292C39" @click="doScan"></uni-icons> + <uni-icons type="gear-filled" size="48rpx" color="#292C39" @click="goSetAddress"></uni-icons> + </view> <view class="login-main"> <text class="login-main-title">娆㈣繋鐧诲綍</text> - <view class="login-main-subtitle">鑰�鑳芥柊鑳芥簮PDA绋嬪簭</view> + <view class="login-main-subtitle">璧i攱鏂拌兘婧怭DA绋嬪簭</view> <view class="login-main-body"> <!-- <login-input key="username" v-model="user" clearable placeholder="鐢ㄦ埛鍚�" :maxlength="20"></login-input> --> @@ -17,11 +21,11 @@ :maxlength="10"></uni-easyinput> <view class="canvas-img-code" @click="refresh()"> <img :src="validCodeBase64" :style="{ width: width + 'px', height: height + 'px' }" - class="login-validCode-img"/> - <!-- <img v-show="validCodeBase64 != ''" :src="validCodeBase64" :style="{ width: width + 'px', height: height + 'px' }"/> --> + class="login-validCode-img" /> + <!-- <img v-show="validCodeBase64 != ''" :src="validCodeBase64" :style="{ width: width + 'px', height: height + 'px' }"/> --> </view> </view> - + <u-button type="success" size="default" shape="circle" :ripple="true" ripple-bg-color="#909399" @click="login"> 鐧诲綍 @@ -48,13 +52,17 @@ SYS_DEFAULT_CAPTCHA_OPEN: true, validCodeBase64: '', validCodeReqNo: '', - code:'1234' + code: '1234' } }, onLoad(options) { this.configSysBaseList() }, methods: { + //璺宠浆鍒癝etAddress椤甸潰 + goSetAddress() { + this.$u.route('/pages/SetAddress/SetAddress'); + }, configSysBaseList() { // this.$u.get('/api/User/getVierificationCode', null).then(res => { // if (res.code == 200) { @@ -67,19 +75,19 @@ // } // } // }) - //濡傛灉楠岃瘉鐮佸紑鍏虫槸寮�灏卞姞杞介獙璇佺爜 - if (this.SYS_DEFAULT_CAPTCHA_OPEN) { - this.loginCaptcha() - } - // } - // }) + //濡傛灉楠岃瘉鐮佸紑鍏虫槸寮�灏卞姞杞介獙璇佺爜 + if (this.SYS_DEFAULT_CAPTCHA_OPEN) { + this.loginCaptcha() + } + // } + // }) }, loginCaptcha() { this.$u.get('/api/User/getVierificationCode', null).then(res => { - - this.validCodeBase64 = "data:image/png;base64," + res.img; + + this.validCodeBase64 = "data:image/png;base64," + res.img; this.validCodeReqNo = res.uuid - + }) }, refresh() { @@ -104,12 +112,12 @@ // UserName: this.user, // VerificationCode: this.SYS_DEFAULT_CAPTCHA_OPEN ? this.code : null // } - this.$u.post('/api/User/login', - {UUID: this.validCodeReqNo, - passWord: this.pass, - userName: this.user, - verificationCode: this.code} - ).then(res => { + this.$u.post('/api/User/login', { + UUID: this.validCodeReqNo, + passWord: this.pass, + userName: this.user, + verificationCode: this.code + }).then(res => { console.log(res) this.$t.message.toast("鐧诲綍鎴愬姛") this.$t.message.closeLoading() @@ -136,6 +144,14 @@ </script> <style lang="scss" scoped> + .tools { + display: flex; + justify-content: space-between; + margin-bottom: 32rpx; + box-sizing: border-box; + padding: 0 12rpx; + } + .login { // font-family: PingFangSC-Regular, PingFang SC; // background-color: $color-white; diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/NEWCode/WIDESEAWCS_PDA/pages/\345\217\253\346\226\231/\346\255\243\346\236\201\345\217\253\346\226\231.vue" "b/\344\273\243\347\240\201\347\256\241\347\220\206/NEWCode/WIDESEAWCS_PDA/pages/\345\217\253\346\226\231/\346\255\243\346\236\201\345\217\253\346\226\231.vue" index 837fd36..c21e3f5 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/NEWCode/WIDESEAWCS_PDA/pages/\345\217\253\346\226\231/\346\255\243\346\236\201\345\217\253\346\226\231.vue" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/NEWCode/WIDESEAWCS_PDA/pages/\345\217\253\346\226\231/\346\255\243\346\236\201\345\217\253\346\226\231.vue" @@ -92,21 +92,32 @@ } }, submit(cb) { - this.$t.message.loading(); - let formDataParam = { - current: this.current, - size: this.size - }; - // 浣跨敤鍒涙櫤瀹屾暣鎺ュ彛 - this.$u.post('/api/PDA/AGVPage', null).then(res => { - console.log(res); - this.$t.message.closeLoading(); - cb && cb(); - if (cb != null) this.listData = []; - this.listData = [...this.listData, ...res.data]; - console.log(this.listData); - }).catch((err) => { - this.$t.message.toast(err.message); + uni.getStorage({ + key: 'storage_key_ipAddress', + success: (res) => { + this.$t.message.loading(); + let formDataParam = { + current: this.current, + size: this.size + }; + // 浣跨敤鍒涙櫤瀹屾暣鎺ュ彛 + this.$u.post(res.data.CZFJiP + '/api/PDA/AGVPage', null).then(res => { + console.log(res); + this.$t.message.closeLoading(); + cb && cb(); + if (cb != null) this.listData = []; + this.listData = [...this.listData, ...res.data]; + console.log(this.listData); + }).catch((err) => { + this.$t.message.toast(err.message); + }); + }, + fail: (err) => { + this.$t.message.toast('璇峰厛璁剧疆IP鍦板潃'); + uni.navigateTo({ + url: '/pages/SetAddress/SetAddress', + }); + }, }); }, clickLoadMore(e) { @@ -151,8 +162,9 @@ }; this.$u.post('/api/PDA/AddCZTask', formDataParam).then(res => { if (res.status) { + const value = uni.getStorageSync('storage_key_ipAddress'); // 浣跨敤鍒涙櫤瀹屾暣鎺ュ彛 - this.$u.post('/api/PDA/insertTask', formDataParam).then(res => { + this.$u.post(value.CZZJip + '/api/PDA/insertTask', formDataParam).then(res => { this.$t.message.closeLoading(); if (res.status) { this.$t.message.toast('鍛煎彨鎴愬姛'); diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/NEWCode/WIDESEAWCS_PDA/pages/\345\217\253\346\226\231/\350\264\237\346\236\201\345\217\253\346\226\231.vue" "b/\344\273\243\347\240\201\347\256\241\347\220\206/NEWCode/WIDESEAWCS_PDA/pages/\345\217\253\346\226\231/\350\264\237\346\236\201\345\217\253\346\226\231.vue" index afe0010..a2fb588 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/NEWCode/WIDESEAWCS_PDA/pages/\345\217\253\346\226\231/\350\264\237\346\236\201\345\217\253\346\226\231.vue" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/NEWCode/WIDESEAWCS_PDA/pages/\345\217\253\346\226\231/\350\264\237\346\236\201\345\217\253\346\226\231.vue" @@ -101,7 +101,7 @@ size: this.size }; // 浣跨敤鍒涙櫤瀹屾暣鎺ュ彛 - this.$u.post(res.data.CZFJiP, null).then(res => { + this.$u.post(res.data.CZFJiP + '/api/PDA/AGVPage', null).then(res => { console.log(res); this.$t.message.closeLoading(); cb && cb(); @@ -162,10 +162,11 @@ // ...鍏朵粬闇�瑕佷紶閫掔殑鍙傛暟 }; - // 浣跨敤鍒涙櫤瀹屾暣鎺ュ彛 - this.$u.post('/api/PDA/insertTask', formDataParam).then(res => { + this.$u.post('/api/PDA/AddCZTask', formDataParam).then(res => { if (res.status) { - this.$u.post('/api/PDA/AddCZTask', formDataParam).then(res => { + const value = uni.getStorageSync('storage_key_ipAddress'); + // 浣跨敤鍒涙櫤瀹屾暣鎺ュ彛 + this.$u.post(value.CZFJiP + '/api/PDA/insertTask', formDataParam).then(res => { this.$t.message.closeLoading(); if (res.status) { this.$t.message.toast('鍛煎彨鎴愬姛'); diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/NEWCode/WIDESEAWCS_PDA/uview-ui/libs/request/index.js" "b/\344\273\243\347\240\201\347\256\241\347\220\206/NEWCode/WIDESEAWCS_PDA/uview-ui/libs/request/index.js" index c07f38a..b44e737 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/NEWCode/WIDESEAWCS_PDA/uview-ui/libs/request/index.js" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/NEWCode/WIDESEAWCS_PDA/uview-ui/libs/request/index.js" @@ -30,6 +30,7 @@ options.complete = (response) => { // 璇锋眰杩斿洖鍚庯紝闅愯棌loading(濡傛灉璇锋眰杩斿洖蹇殑璇濓紝鍙兘浼氭病鏈塴oading) uni.hideLoading(); + // 娓呴櫎瀹氭椂鍣紝濡傛灉璇锋眰鍥炴潵浜嗭紝灏辨棤闇�loading clearTimeout(this.config.timer); this.config.timer = null; @@ -74,7 +75,6 @@ } } } - // 鍒ゆ柇鏄惁涓哄畬鏁� URL锛屽鏋滄槸鍒欎笉浣跨敤 baseUrl if (options.url.includes('http://') || options.url.includes('https://')) { options.url = options.url; diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/NEWCode/WIDESEAWCS_Server/WIDESEAWCS_Server/WIDESEAWCS.xml" "b/\344\273\243\347\240\201\347\256\241\347\220\206/NEWCode/WIDESEAWCS_Server/WIDESEAWCS_Server/WIDESEAWCS.xml" index c2e6ad0..021feea 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/NEWCode/WIDESEAWCS_Server/WIDESEAWCS_Server/WIDESEAWCS.xml" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/NEWCode/WIDESEAWCS_Server/WIDESEAWCS_Server/WIDESEAWCS.xml" @@ -32,6 +32,13 @@ <param name="sysSchedule"></param> <returns></returns> </member> + <member name="M:WIDESEAWCS_WCSServer.Controllers.Task.TaskController.ReceiveWMSTask(System.Collections.Generic.List{WIDESEAWCS_DTO.TaskInfo.WMSTaskDTO})"> + <summary> + + </summary> + <param name="taskDTOs"></param> + <returns></returns> + </member> <member name="T:WIDESEAWCS_WCSServer.Filter.AutoMapperConfig"> <summary> 闈欐�佸叏灞� AutoMapper 閰嶇疆鏂囦欢 -- Gitblit v1.9.3