|
@@ -3,7 +3,7 @@
|
|
|
<view class="container">
|
|
|
<view class='container_content'>
|
|
|
<view class="head">
|
|
|
- <view style='margin-bottom:14px;' class="row flex flex-end">
|
|
|
+ <view style='margin-bottom:14px;' class="row flex flex-end" v-if='hasLogin'>
|
|
|
<u--image class='image' :showLoading="true" src="../../static/mine/saoma.png" width="20px"
|
|
|
height="20px" @click="scanCode()"></u--image>
|
|
|
<u--image @click="goDetailPage('/pages/mine/set')" style='margin-right:0;' class='image'
|
|
@@ -226,50 +226,22 @@
|
|
|
uni.scanCode({
|
|
|
onlyFromCamera: true,
|
|
|
success: function(res) {
|
|
|
- console.log('条码类型:' + res.scanType);
|
|
|
console.log('条码内容:' + res.result);
|
|
|
- _this.sessionId = res.result;
|
|
|
- uni.getStorage({
|
|
|
- key: 'info',
|
|
|
- success: (resStore) => {
|
|
|
- let infoJson = JSON.parse(resStore.data);
|
|
|
- console.log(infoJson);
|
|
|
- _this.token = infoJson.token;
|
|
|
- _this.httpUrl = infoJson.httpUrl;
|
|
|
- console.log(_this.token, _this.httpUrl);
|
|
|
- _this.mobileScanOk();
|
|
|
- }
|
|
|
- });
|
|
|
+
|
|
|
+ _this.token = res.result.split('?token=')[1];
|
|
|
+ _this.mobileScanOk();
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
mobileScanOk() {
|
|
|
- this.$request.baseRequest('get', '/cargoOwnerInfo/firstAuthentication', {
|
|
|
- sessionId: this.sessionId,
|
|
|
+ this.$request.baseRequest('get', '/login/loginInfo', {
|
|
|
token: this.token
|
|
|
}).then(res => {
|
|
|
- let resultData = res.data;
|
|
|
+ let resultData = res;
|
|
|
console.log(resultData);
|
|
|
- if (resultData.code == 0) {
|
|
|
-
|
|
|
- let status = resultData.data.status;
|
|
|
- if (status == 1) { //登录成功
|
|
|
- this.username = resultData.data.username;
|
|
|
- uni.navigateTo({
|
|
|
- url: `./confirm?token=${this.token}&sessionId=${this.sessionId}&httpUrl=${this.httpUrl}&username=${this.username}`
|
|
|
- });
|
|
|
- } else {
|
|
|
- uni.showToast({
|
|
|
- title: resultData.msg,
|
|
|
- duration: 2000
|
|
|
- });
|
|
|
- }
|
|
|
- } else {
|
|
|
- uni.showToast({
|
|
|
- title: resultData.msg,
|
|
|
- duration: 2000
|
|
|
- });
|
|
|
- }
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `./confirm?token=${this.token}`
|
|
|
+ });
|
|
|
|
|
|
})
|
|
|
},
|