api接口baseUrl通过全局变量引入;代码格式化
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
// pages/visitor/showMyVisitor.js
|
||||
Page({
|
||||
const app = getApp()
|
||||
const baseUrl = app.globalData.baseUrl
|
||||
// console.log("baseUrl", baseUrl)
|
||||
|
||||
Page({
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
@@ -25,22 +27,22 @@ Page({
|
||||
})
|
||||
} else {
|
||||
wx.request({
|
||||
url: 'http://127.0.0.1:8080/visitor/showMyVisitor',
|
||||
url: `${baseUrl}/visitor/showMyVisitor`,
|
||||
data: {
|
||||
phone: this.data.phone,
|
||||
},
|
||||
success: function (d) {
|
||||
if (d.data == "审批通过") {
|
||||
that.setData({
|
||||
greenCode:true,
|
||||
redCode:false,
|
||||
msg:d.data
|
||||
greenCode: true,
|
||||
redCode: false,
|
||||
msg: d.data
|
||||
})
|
||||
}else{
|
||||
} else {
|
||||
that.setData({
|
||||
greenCode:false,
|
||||
redCode:true,
|
||||
msg:d.data
|
||||
greenCode: false,
|
||||
redCode: true,
|
||||
msg: d.data
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -102,4 +104,4 @@ Page({
|
||||
onShareAppMessage: function () {
|
||||
|
||||
}
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user