diff --git a/common/airport.js b/common/airport.js deleted file mode 100644 index 445b6aa4426d77dab36bc383a389a420302eccfc..0000000000000000000000000000000000000000 --- a/common/airport.js +++ /dev/null @@ -1,262 +0,0 @@ -export default { - "list": [{ - "letter": "A", - "data": [ - "闃垮厠鑻忔満鍦�", - "闃挎媺灞卞彛鏈哄満", - "闃垮嫆娉版満鍦�", - "闃块噷鏄嗚帋鏈哄満", - "瀹夊簡澶╂煴灞辨満鍦�", - "婢抽棬鍥介檯鏈哄満" - ] - }, { - "letter": "B", - "data": [ - "淇濆北鏈哄満", - "鍖呭ご鏈哄満", - "鍖楁捣绂忔垚鏈哄満", - "鍖椾含鍗楄嫅鏈哄満", - "鍖椾含棣栭兘鍥介檯鏈哄満" - ] - }, { - "letter": "C", - "data": [ - "闀跨櫧灞辨満鍦�", - "闀挎槬榫欏槈鍥介檯鏈哄満", - "甯稿痉妗冭姳婧愭満鍦�", - "鏄岄兘閭﹁揪鏈哄満", - "闀挎矙榛勮姳鍥介檯鏈哄満", - "闀挎不鐜嬫潙鏈哄満", - "甯稿窞濂旂墰鏈哄満", - "鎴愰兘鍙屾祦鍥介檯鏈哄満", - "璧ゅ嘲鏈哄満" - ] - }, { - "letter": "D", - "data": [ - "澶х悊鏈哄満", - "澶ц繛鍛ㄦ按瀛愬浗闄呮満鍦�", - "澶у簡钀ㄥ皵鍥炬満鍦�", - "澶у悓涓滅帇搴勬満鍦�", - "杈惧窞娌冲競鏈哄満", - "涓逛笢娴ご鏈哄満", - "寰峰畯鑺掑競鏈哄満", - "杩簡棣欐牸閲屾媺鏈哄満", - "涓滆惀鏈哄満", - "鏁︾厡鏈哄満" - ] - }, { - "letter": "E", - "data": [ - "閯傚皵澶氭柉鏈哄満", - "鎭╂柦璁稿鍧満鍦�", - "浜岃繛娴╃壒璧涗箤鑻忓浗闄呮満鍦�" - ] - }, { - "letter": "F", - "data": [ - "闃滈槼瑗垮叧鏈哄満", - "绂忓窞闀夸箰鍥介檯鏈哄満" - ] - }, { - "letter": "G", - "data": [ - "璧e窞榛勯噾鏈哄満", - "鏍煎皵鏈ㄦ満鍦�", - "鍥哄師鍏洏灞辨満鍦�", - "骞垮厓鐩橀緳鏈哄満", - "骞垮窞鐧戒簯鍥介檯鏈哄満", - "妗傛灄涓ゆ睙鍥介檯鏈哄満", - "璐甸槼榫欐礊鍫″浗闄呮満鍦�" - ] - }, { - "letter": "H", - "data": [ - "鍝堝皵婊ㄥお骞冲浗闄呮満鍦�", - "鍝堝瘑鏈哄満", - "娴峰彛缇庡叞鍥介檯鏈哄満", - "娴锋媺灏斾笢灞卞浗闄呮満鍦�", - "閭兏鏈哄満", - "姹変腑鏈哄満", - "鏉窞钀у北鍥介檯鏈哄満", - "鍚堣偉楠嗗矖鍥介檯鏈哄満", - "鍜岀敯鏈哄満", - "榛戞渤鏈哄満", - "鍛煎拰娴╃壒鐧藉鍥介檯鏈哄満", - "娣畨娑熸按鏈哄満", - "榛勫北灞邯鍥介檯鏈哄満" - ] - }, { - "letter": "I", - "data": [] - }, { - "letter": "J", - "data": [ - "娴庡崡閬ュ鍥介檯鏈哄満", - "娴庡畞鏇查槣鏈哄満", - "楦¤タ鍏村嚡婀栨満鍦�", - "浣虫湪鏂笢閮婃満鍦�", - "鍢夊唱鍏虫満鍦�", - "閿﹀窞灏忓箔瀛愭満鍦�", - "鏅痉闀囨満鍦�", - "浜曞唸灞辨満鍦�", - "涔濇睙搴愬北鏈哄満", - "涔濆榛勯緳鏈哄満" - ] - }, { - "letter": "K", - "data": [ - "鍠€浠€鏈哄満", - "鍏嬫媺鐜涗緷鏈哄満", - "搴撹溅榫熷吂鏈哄満", - "搴撳皵鍕掓満鍦�", - "鏄嗘槑宸鍧濆浗闄呮満鍦�" - ] - }, { - "letter": "L", - "data": [ - "鎷夎惃璐″槑鏈哄満", - "鍏板窞涓窛鏈哄満", - "涓芥睙涓変箟鏈哄満", - "榛庡钩鏈哄満", - "杩炰簯娓櫧濉斿煚鏈哄満", - "涓存钵鏈哄満", - "涓存矀鏈哄満", - "鏋楄姖绫虫灄鏈哄満", - "鏌冲窞鐧借幉鏈哄満", - "榫欏博鍐犺备灞辨満鍦�", - "娉稿窞钃濈敯鏈哄満", - "娲涢槼鍖楅儕鏈哄満" - ] - }, { - "letter": "M", - "data": [ - "婊℃床閲岃タ閮婃満鍦�", - "缁甸槼鍗楅儕鏈哄満", - "婕犳渤鍙よ幉鏈哄満", - "鐗′腹姹熸捣娴満鍦�" - ] - }, { - "letter": "N", - "data": [ - "鍗楁槍鏄屽寳鍥介檯鏈哄満", - "鍗楀厖楂樺潽鏈哄満", - "鍗椾含绂勫彛鍥介檯鏈哄満", - "鍗楀畞鍚村湬鏈哄満", - "鍗楅€氬叴涓滄満鍦�", - "鍗楅槼濮滆惀鏈哄満", - "瀹佹尝鏍庣ぞ鍥介檯鏈哄満" - ] - }, { - "letter": "O", - "data": [] - }, { - "letter": "P", - "data": [ - "鏅幢鎬濊寘鏈哄満" - ] - }, { - "letter": "Q", - "data": [ - "榻愰綈鍝堝皵涓夊瀛愭満鍦�", - "绉︾殗宀涘北娴峰叧鏈哄満", - "闈掑矝娴佷涵鍥介檯鏈哄満", - "琛㈠窞鏈哄満", - "娉夊窞鏅嬫睙鏈哄満" - ] - }, { - "letter": "R", - "data": [ - "鏃ュ杸鍒欏拰骞虫満鍦�" - ] - }, { - "letter": "S", - "data": [ - "涓変簹鍑ゅ嚢鍥介檯鏈哄満", - "姹曞ご澶栫爞鏈哄満", - "涓婃捣铏规ˉ鍥介檯鏈哄満", - "涓婃捣娴︿笢鍥介檯鏈哄満", - "娣卞湷瀹濆畨鍥介檯鏈哄満", - "娌堥槼妗冧粰鍥介檯鏈哄満", - "鐭冲搴勬瀹氬浗闄呮満鍦�", - "鑻忓崡纭曟斁鍥介檯鏈哄満" - ] - }, { - "letter": "T", - "data": [ - "濉斿煄鏈哄満", - "澶師姝﹀鍥介檯鏈哄満", - "鍙板窞璺ˉ鏈哄満 (榛勫博鏈哄満)", - "鍞愬北涓夊コ娌虫満鍦�", - "鑵惧啿椹煎嘲鏈哄満", - "澶╂触婊ㄦ捣鍥介檯鏈哄満", - "閫氳窘鏈哄満", - "閾滀粊鍑ゅ嚢鏈哄満" - ] - }, { - "letter": "U", - "data": [] - }, { - "letter": "V", - "data": [] - }, { - "letter": "W", - "data": [ - "涓囧窞浜旀ˉ鏈哄満", - "娼嶅潑鏈哄満", - "濞佹捣澶ф按娉婃満鍦�", - "鏂囧北鏅€呴粦鏈哄満", - "娓╁窞姘稿己鍥介檯鏈哄満", - "涔屾捣鏈哄満", - "姝︽眽澶╂渤鍥介檯鏈哄満", - "涔屽叞娴╃壒鏈哄満", - "涔岄瞾鏈ㄩ綈鍦扮獫鍫″浗闄呮満鍦�", - "姝﹀し灞辨満鍦�", - "姊у窞闀挎床宀涙満鍦�" - ] - }, { - "letter": "X", - "data": [ - "瑗垮畨鍜搁槼鍥介檯鏈哄満", - "瑗挎槍闈掑北鏈哄満", - "閿℃灄娴╃壒鏈哄満", - "瑗垮畞鏇瑰鍫℃満鍦�", - "瑗垮弻鐗堢撼鍢庢磼鏈哄満", - "鍘﹂棬楂樺磶鍥介檯鏈哄満", - "棣欐腐鍥介檯鏈哄満", - "瑗勯槼鍒橀泦鏈哄満", - "鍏翠箟鏈哄満", - "寰愬窞瑙傞煶鏈哄満" - ] - }, { - "letter": "Y", - "data": [ - "寤跺畨浜屽崄閲屽牎鏈哄満", - "鐩愬煄鏈哄満", - "寤跺悏鏈濋槼宸濇満鍦�", - "鐑熷彴鑾卞北鍥介檯鏈哄満", - "瀹滃鑿滃潩鏈哄満", - "瀹滄槍涓夊场鏈哄満", - "浼婃槬鏋楅兘鏈哄満", - "浼婂畞鏈哄満", - "涔変箤鏈哄満", - "閾跺窛娌充笢鏈哄満", - "姘稿窞闆堕櫟鏈哄満", - "姒嗘灄姒嗛槼鏈哄満", - "鐜夋爲宸村鏈哄満", - "杩愬煄寮犲瓭鏈哄満" - ] - }, { - "letter": "Z", - "data": [ - "婀涙睙鏈哄満", - "鏄€氭満鍦�", - "閮戝窞鏂伴儜鍥介檯鏈哄満", - "鑺锋睙鏈哄満", - "閲嶅簡姹熷寳鍥介檯鏈哄満", - "涓崼棣欏北鏈哄満", - "鑸熷北鏈卞灏栨満鍦�", - "鐝犳捣涓夌伓鏈哄満" - ] - }] -} diff --git a/common/request.js b/common/request.js index 5fafd699fbd7444b0d045128f20fd6ea6045ddb7..0e54cf7bf9d6130d9b1edf195e55d7cf11cec5f8 100644 --- a/common/request.js +++ b/common/request.js @@ -1,6 +1,5 @@ -import { showCustomModal } from "./util"; +import { showCustomModal, storageInfo } from "./util"; import { BASEURL, REQUESTIMEOUT } from "./config"; -console.log(BASEURL, 'BASEURLBASEURLBASEURL') const BASE_URL = BASEURL; const REQUEST_TIMEOUT = REQUESTIMEOUT; @@ -13,6 +12,7 @@ export default function request(options) { data: options.data || {}, header: options.header || { 'Content-Type': 'application/json', + 'Authorization': storageInfo.get('token') }, success: (res) => { console.log(res, 'request') @@ -40,6 +40,17 @@ uni.addInterceptor("request", { msg } = res.data; console.log('addInterceptor', code, msg) + if(code === 401){ + showCustomModal({ + content: msg, + success: function() { + uni.reLaunch({ // 鐧诲綍瓒呮椂璺宠浆鐧诲綍椤甸潰 + url: "/pages/user/login" + }) + } + }); + return + } if (code !== 200) { showCustomModal({ content: msg, @@ -49,6 +60,7 @@ uni.addInterceptor("request", { // }); return; } + return Promise.resolve(res.data); }, fail(err) { diff --git a/common/util.js b/common/util.js index 95eba326054470df34ce68f9f62ea5114ca8c6c7..a6e6d8b2f51f0b37ce073f371733e1ddb14ebba0 100644 --- a/common/util.js +++ b/common/util.js @@ -274,6 +274,58 @@ function stringToBytes(str) { // return an array of bytes return re; } +var dater = { + getDate: function(type) { + const date = new Date(); + let year = date.getFullYear(); + let month = date.getMonth() + 1; + let day = date.getDate(); + + if (type === 'start') { + year = year - 60; + } else if (type === 'end') { + year = year + 2; + } + month = month > 9 ? month : '0' + month; + day = day > 9 ? day : '0' + day; + return `${year}-${month}-${day}`; + }, +} +var storager = { + set: function(key, content){ + uni.setStorageSync(key, content) + }, + get: function(key){ + return uni.getStorageSync(key) + } +} + +var popuper = { + showLoading: function(obj){ + uni.showLoading({ + title: obj.title || '鍔犺浇涓�...', + mask: true + }) + }, + hideLoading: function(){ + uni.hideLoading() + } +} + +var pager = { + navTo: function(url){ + uni.navigateTo({ + url + }) + }, + relaunchTo: function(url){ + uni.reLaunch({ + url + }) + } +} + + var blueToother = { openBluetoothAdapter: function() { return new Promise((resolve, reject) => { @@ -467,5 +519,10 @@ export { showCustomToast, commonStateCodeDeal, blueToother, - getCurrentPage + getCurrentPage, + popuper, + storager, + dater, + pager + } \ No newline at end of file diff --git a/pages/home/blueMeasure.vue b/pages/home/blueMeasure.vue index 2d60247a266b2498eab4f1eedf3d2c081641ff33..bf69ed2f02fbfd2ffbc154dd07fe341965dd7328 100644 --- a/pages/home/blueMeasure.vue +++ b/pages/home/blueMeasure.vue @@ -103,7 +103,7 @@ <view>澶囨敞</view> </uni-col> <uni-col :span="15"> - <input class="uni-input inputEle" focus placeholder="璇疯緭鍏�" /> + <input class="uni-input inputEle" placeholder="璇疯緭鍏�" /> </uni-col> </uni-row> </view> diff --git a/pages/home/home.vue b/pages/home/home.vue index e438c2553890fc22a98bd8e6a41048d00573d6ac..22b3d608b6789747d2d0001d8eed3f35fdf25023 100644 --- a/pages/home/home.vue +++ b/pages/home/home.vue @@ -70,16 +70,14 @@ </template> <script> - import { - formatNumber, - formatDateThis, - getUnixTime - } from "../../common/dateUtil.js" import { stringToBytes, showCustomModal, showCustomToast, - commonStateCodeDeal + commonStateCodeDeal, + popup, + storager, + pager } from "../../common/util.js" import * as XLSX from '@/common/excel.js' import { @@ -104,6 +102,9 @@ uni.hideLoading() }, mounted() { + + + const deviceInfo = uni.getStorageSync('deviceInfo') if (deviceInfo) { // 鑾峰彇钃濈墮璁惧鍨嬪彿id this.deviceInfo = deviceInfo @@ -124,9 +125,21 @@ filePath: res.tempFiles[0].path, name: 'file', //鎺ュ彛闇€瑕佺殑鍙傛暟鍚� header: { + 'Authorization': storager.get('token') }, success(uploadRes) { const res = JSON.parse(uploadRes.data) + if(res.code === 401){ + showCustomModal({ + content: res.msg, + success: function() { + pager.navTo({ // 鐧诲綍瓒呮椂璺宠浆鐧诲綍椤甸潰 + url: "/pages/user/login" + }) + } + }); + return + } showCustomToast({ title: res.msg }) diff --git a/pages/home/operateLog.vue b/pages/home/operateLog.vue index ab0479e4bc47d7285b513a43837798b4c3d55bc8..36ea0f4ab4c3cce3c4a1996e31836880b34fc2b3 100644 --- a/pages/home/operateLog.vue +++ b/pages/home/operateLog.vue @@ -4,25 +4,13 @@ </CustomNavbar> <view class="body-wrapper"> - <view class="demo-uni-row"> - <uni-row> - <uni-col :span="6" class="_title"> - <view>宸ョ▼鍚嶇О</view> - </uni-col> - <uni-col :span="16"> - <uni-data-select v-model="form.productName" :localdata="selectListLv1" :clear="false" - @change="changeLv1"></uni-data-select> - </uni-col> - </uni-row> - </view> <view class="demo-uni-row"> <uni-row class="demo-uni-row mb-10"> <uni-col :span="6" class="_title"> - <view>鐖嗗尯鍚嶇О</view> + <view>娴嬮噺鍛�</view> </uni-col> <uni-col :span="16"> - <uni-data-select v-model="form.artilleryAreaName" :localdata="selectListLv2" :clear="false" - @change="changeLv2"></uni-data-select> + <input class="uni-input inputEle" v-model="searchForm.operationPerson" placeholder="璇疯緭鍏�" /> </uni-col> </uni-row> </view> @@ -41,7 +29,7 @@ </picker> </uni-col> </uni-row> - <view class="funcBtn end" @tap="resetForm"> + <view class="funcBtn end" @tap="search"> 鎼滅储 </view> </view> @@ -51,20 +39,21 @@ <view class="table-wrapper"> <uni-table ref="table" :loading="loading" emptyText="鏆傛棤鏇村鏁版嵁" @selection-change="selectionChange"> <uni-tr> - <uni-th width="50" align="center"><span style="color:#3a74ba;font-size:30rpx;">搴忓彿</span></uni-th> - <uni-th width="100" align="center">鎿嶄綔妯″潡</uni-th> - <uni-th width="80" align="center">鎿嶄綔绫诲瀷</uni-th> - <uni-th width="120" align="center">鎿嶄綔浜�</uni-th> - <uni-th width="130" align="center">鎿嶄綔鏃堕棿</uni-th> - <uni-th width="200" align="center">鎿嶄綔鍐呭</uni-th> + <uni-th width="50" align="center"><span class="tableTh">搴忓彿</span></uni-th> + <uni-th width="100" align="center"><span class="tableTh">鎿嶄綔妯″潡</span></uni-th> + <uni-th width="80" align="center"><span class="tableTh">鎿嶄綔绫诲瀷</span></uni-th> + <uni-th width="120" align="center"><span class="tableTh">鎿嶄綔浜�</span></uni-th> + <uni-th width="200" align="center"><span class="tableTh">鎿嶄綔鏃堕棿</span></uni-th> + <uni-th width="200" align="center"><span class="tableTh">鎿嶄綔鍐呭</span></uni-th> + </uni-tr> <uni-tr v-for="(item, index) in dataList" :key="index"> - <uni-td align="center">{{index}}</uni-td> - <uni-td align="center">{{ item.operationModule }}</uni-td> - <uni-td align="center">{{ item.operationType }}</uni-td> - <uni-td align="center">{{ item.operationPerson }}</uni-td> - <uni-td align="center">{{ item.operationTime }}</uni-td> - <uni-td align="center">{{ item.operationRemark }}</uni-td> + <uni-td align="center"><span class="tableTd">{{index+1}}</span></uni-td> + <uni-td align="center"><span class="tableTd">{{ item.operationModule }}</span></uni-td> + <uni-td align="center"><span class="tableTd">{{ item.operationType }}</span></uni-td> + <uni-td align="center"><span class="tableTd">{{ item.operationPerson }}</span></uni-td> + <uni-td align="center"><span class="tableTd">{{ item.operationTime }}</span></uni-td> + <uni-td align="center"><span class="tableTd">{{ item.operationRemark }}</span></uni-td> </uni-tr> </uni-table> </view> @@ -76,7 +65,8 @@ import { getCurrentTime, showCustomToast, - showCustomModal + showCustomModal, + dater } from '../../common/util.js' import { getDataList, @@ -88,7 +78,7 @@ CustomNavbar, }, data() { - const currentDate = this.getDate({ + const currentDate = dater.getDate({ format: true }) return { @@ -96,27 +86,10 @@ searchForm: { startTime: currentDate, endTime: currentDate, + operationPerson: '' }, dataList: [], - navBarTitle: '鎿嶄綔鏃ュ織', - redirectUrl: '/pages/home/blueSearch?refer=blueMeasure', - searchDate: '', - // 琛ㄥ崟鏁版嵁鐩稿叧 - zhuangyaoDict: [], - form: { - 'productName': '', - 'artilleryAreaName': '', - 'cannonHoleArrayNum': '', - 'cannonHoleNum': '', - 'status': '', - 'expectedDepth': '', - 'actualDepth': '', - 'actualWaterLevel': '' - }, - - selectList4productName: [], - selectList4tester: [], }; }, @@ -129,10 +102,10 @@ }, computed: { startDate() { - return this.getDate('start'); + return dater.getDate('start'); }, endDate() { - return this.getDate('end'); + return dater.getDate('end'); } }, methods: { @@ -163,69 +136,30 @@ bindDateChange4end: function(e) { this.searchForm.endTime = e.detail.value }, - getDate(type) { - const date = new Date(); - let year = date.getFullYear(); - let month = date.getMonth() + 1; - let day = date.getDate(); - - if (type === 'start') { - year = year - 60; - } else if (type === 'end') { - year = year + 2; - } - month = month > 9 ? month : '0' + month; - day = day > 9 ? day : '0' + day; - return `${year}-${month}-${day}`; - }, - selectDate() { - // 閫氳繃缁勪欢瀹氫箟鐨剅ef璋冪敤uni-popup鏂规硶 ,濡傛灉浼犲叆鍙傛暟 锛宼ype 灞炴€у皢澶辨晥 锛屼粎鏀寔 ['top','left','bottom','right','center'] - this.$refs.popup.open('center') - }, - calendarConfirm(e) { - console.log(e) - const formattedDates = e.map(date => date.split(' ')[0]); - this.searchDate = formattedDates - this.$refs.popup.close() - }, - dateRangeMaxDeal(e) { - console.log('瓒呰繃鏈€澶ц繛閫夊ぉ鏁帮細', e) - }, - async getDetailInfo() { - let res = await getDetailInfo() - if (res) { - this.form['status'] = res['status'] - this.form['expectedDepth'] = res['expectedDepth'] - this.form['designInclination'] = res['designInclination'] - return - } - showCustomToast({ - title: '鏆傛棤璇︽儏淇℃伅' - }) - }, + } }; </script> <style lang="scss"> - ::v-deep .uni-popup .uni-popup__wrapper { - display: block; - position: relative; - width: 80vw; + .tableTh{ + color:#3a74ba;font-size:30rpx; + font-family: Source Han Sans SC; + } + .tableTd{ + color:#000;font-size:30rpx; + font-family: Source Han Sans SC; + font-weight: bold; } - - ::v-deep .uni-select__input-placeholder { // placeholder鏍峰紡璋冩暣 font-size: 30rpx !important; } - - .inputEle { + .inputEle{ height: 110rpx; display: flex; align-items: center; } - .uni-col-6 { font-size: 32rpx; font-weight: bold; @@ -267,30 +201,6 @@ } } - .only-read-row { - background: #E3E6EC !important; - height: 108rpx; - align-items: center; - display: flex; - line-height: 70rpx; - position: relative; - padding-left: 13rpx; - - &:after { - content: '绫�'; - width: 70rpx; - height: 70rpx; - position: absolute; - right: 48rpx; - top: 50%; - transform: translateY(-50%); - text-align: center; - line-height: 70rpx; - font-size: 29rpx; - color: #000000; - } - } - ::v-deep .uni-row::after { clear: both; width: 608rpx; diff --git a/pages/user/login.vue b/pages/user/login.vue index 3075b85f507fb73d226115adfdb74a949ceb0b90..dfbedc634a40ccd6aa6992653591f6325cd43628 100644 --- a/pages/user/login.vue +++ b/pages/user/login.vue @@ -7,10 +7,10 @@ </view> <view class='content'> <view class="title">鎵嬫満鍙�</view> - <input class="uni-input" focus placeholder="璇疯緭鍏ユ墜鏈哄彿" /> + <input class="uni-input" focus placeholder="璇疯緭鍏ユ墜鏈哄彿" v-model="phone" /> </view> - <button class='loginBtn' type='primary' @getuserinfo="wxLogin"> + <button class='loginBtn' type='primary' @click="wxLogin"> 鎺堟潈鐧诲綍 </button> </view> @@ -19,7 +19,7 @@ <script> - import {showCustomToast} from '../../common/util.js' + import {showCustomToast, popuper, storageInfo, pager} from '../../common/util.js' import {login} from '../../api/login.js' export default { onLoad() { @@ -43,24 +43,27 @@ "errMsg": "getUserInfo:ok" } */ - - - }, data() { return { - + phone: '' } }, methods: { async wxLogin(){ - const token = uni.getStorageSync('accessToken') + popuper.hideLoading({title: '鐧诲綍涓�...'}) const loginRes = await this.getWxCode() if(!loginRes.code){ + showCustomToast({ + title: 'code鏈幏鍙�' + }) return } const userInfo = await this.getUserInfo() if(!userInfo.iv){ + showCustomToast({ + title: 'iv鏈幏鍙�' + }) return } await this.getToken(loginRes.code, userInfo) @@ -95,37 +98,20 @@ data: { "code": code, "encryptedIv": userInfo.iv, - "encryptedData": userInfo.encryptedData + "encryptedData": userInfo.encryptedData, + phone: this.phone }, }) console.log('res', res) + popuper.hideLoading() + if(res){ - uni.setStorageSync('accessToken', res.token) + storageInfo.set('token', res.token) console.log('鑾峰彇token', res.token) - } - - // let [error, res] = await uni.request({ - // url: `http://192.168.2.14:8080/weixin/wxLogin`, - // data: { - // "code": code, - // "encryptedIv": userInfo.iv, - // "encryptedData": userInfo.encryptedData - // }, - // method: 'POST', - // header: { - // // 'accessToken': uni.getStorageSync('accessToken'), - // } - // }); - - // if (error) { - // showCustomToast({ - // title: '缃戠粶閿欒' - // }) - // return - // } - // if(res.data.code === 200){ - // uni.setStorageSync('accessToken', res.data.token) - // } + pager.relaunchTo({ + url: '/pages/home/home' + }) + } } }