token修改

master
Tuisku 3 years ago
parent 40567d2e48
commit b7d0a2a0bd

@ -1,4 +1,7 @@
// pages/quest/quest.js
import {
http
} from '../../utils/util'
Page({
/**
@ -271,6 +274,7 @@ Page({
title: '任务中心',
success: function (res) {}
})
http("/task/list", "post", '')
},
/**

@ -37,7 +37,7 @@ Component({
console.log(e.detail.value)
console.log(this.data)
this.setData({
[form.add]: e.detail.value
'form.add': e.detail.value
})
},
}

@ -21,8 +21,8 @@
<!-- <input class="placeholder" placeholder="输入姓名" bindblur="blur" data-mes="name"></input> -->
<picker mode="region" bindchange="getUserProvince">
<view class="placeholder">
<text wx:if="{{form.add}}">{{form.add}}</text>
<text wx:else="{{form}}">请选择地区</text>
<text wx:if="{{form.add[2]}}">{{form.add}}</text>
<text style="color:gray;" wx:else="{{true}}">请选择地区</text>
</view>
</picker>
<view class="hr"></view>
@ -30,7 +30,7 @@
<image style="width: 48rpx;height: 48rpx;margin-right: 16rpx;" src="../../image/ic_gzcx@2x.png"></image>
关注车型
</view>
<view class="placeholder">请选择关注车型
<view class="placeholder" style="color:gray;">请选择关注车型
</view>
<view class="hr"></view>
<view class="title">
@ -44,4 +44,11 @@
<!-- 底部按钮 -->
<view class="bot">
<view class="button">上传</view>
</view>
</view>
<!-- 选择关注车型 -->
<l-arc-popup show="{{platformdia}}" max-height="700" min-height="200">
<view class="platitle">选择平台</view>
<view class="pla" wx:for="{{platforms}}" wx:key="index" data-mes="{{platforms[index]}}" bindtap="plachoose2">{{item.name}}
<view class="plaline" wx:if="{{index < platforms.length - 1}}"></view>
</view>
</l-arc-popup>

@ -8,11 +8,12 @@ Page({
},
getlist() {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**

@ -67,7 +67,7 @@ Page({
if (res.msg === "未注册!") {
this.getUserProfile()
} else {
// getApp().globalData.token = res.token
getApp().globalData.token = res.data.token
this.setData({
user_avatar:res.data.user.avatar,
user_name:res.data.user.name,

@ -26,10 +26,21 @@ const http = (url, method, data, isLoading = true) => {
}
return new Promise(function (resolve, reject) {
let token = getApp().globalData.token
// wx.getStorage({
// key: 'token',
// success (res) {
// // console.log(res.data)
// let token = res.data
// },
// fail (res) {
// console.log(res)
// wx.hideLoading();
// }
// })
let header = {
'Customer-Wxapp-Token': token
'token': token
}
// if (token && uid) {
if (token) {
wx.request({
url: host + url,
data: data,
@ -55,13 +66,13 @@ const http = (url, method, data, isLoading = true) => {
wx.hideLoading();
}
})
// } else {
// wx.showToast({
// title: '未登录\r\n点击个人中心头像登录',
// icon: 'none',
// duration: 2000
// })
// }
} else {
wx.showToast({
title: '未登录\r\n点击个人中心头像登录',
icon: 'none',
duration: 2000
})
}
})
}

Loading…
Cancel
Save