api接口baseUrl通过全局变量引入;代码格式化
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
// pages/other/feedback.js
|
||||
const app = getApp()
|
||||
const baseUrl = app.globalData.baseUrl
|
||||
// console.log("baseUrl", baseUrl)
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
feedbackList:'',
|
||||
feedbackList: '',
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -28,13 +31,13 @@ Page({
|
||||
onShow: function () {
|
||||
var that = this;
|
||||
wx.request({
|
||||
url: 'http://127.0.0.1:8080/other/feedbackList',
|
||||
url: `${baseUrl}/other/feedbackList`,
|
||||
data: {
|
||||
id:wx.getStorageSync('id')
|
||||
id: wx.getStorageSync('id')
|
||||
},
|
||||
success: function (d) {
|
||||
for (const iterator of d.data.data) {
|
||||
if(!iterator.reply){
|
||||
if (!iterator.reply) {
|
||||
iterator.reply = "暂无"
|
||||
}
|
||||
}
|
||||
@@ -79,4 +82,4 @@ Page({
|
||||
onShareAppMessage: function () {
|
||||
|
||||
}
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user