Commit 4a4e4a7f by ArronYR

modify api request

parent d2ed8a2b
<!--pages/auth/index.wxml--> <!--pages/auth/index.wxml-->
<view class='v-page'> <view class='v-page'>
<view class='container'>
<image src='/images/icon_location.png' mode='scaleToFill'></image>
<view></view>
</view>
</view> </view>
\ No newline at end of file
/* pages/auth/index.wxss */ /* pages/auth/index.wxss */
page {
background: #fff;
}
/* pages/guide/index.wxss */ /* pages/guide/index.wxss */
...@@ -38,10 +38,7 @@ class Request { ...@@ -38,10 +38,7 @@ class Request {
wx.request({ wx.request({
url: (this._baseUrl || '') + url, url: (this._baseUrl || '') + url,
method: method || METHOD.GET, method: method || METHOD.GET,
data: { data: data,
token: wx.getStorageSync('token'),
...data
},
header: { header: {
...this._header, ...this._header,
...header ...header
...@@ -65,7 +62,10 @@ class Request { ...@@ -65,7 +62,10 @@ class Request {
url, url,
method: METHOD.POST, method: METHOD.POST,
header, header,
data: Util.sign(data) data: Util.sign({
...data,
token: wx.getStorageSync('token')
})
}) })
} }
put(url, data, header) { put(url, data, header) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment