1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee

api接口baseUrl通过全局变量引入;代码格式化

This commit is contained in:
2022-11-05 16:45:52 +08:00
parent 3e0c182bc9
commit 5cf1ed3a49
22 changed files with 477 additions and 406 deletions

View File

@@ -1,12 +1,15 @@
//issues.js
//获取应用实例
var app = getApp();
const app = getApp()
const baseUrl = app.globalData.baseUrl
// console.log("baseUrl", baseUrl)
var util = require('../../utils/util')
Page({
data: {
title: '',
content: '',
time:''
time: ''
},
titleInput: function (e) {
@@ -21,15 +24,15 @@ Page({
})
},
submit:function () {
submit: function () {
var TIME = util.formatTime(new Date());
wx.request({
url: 'http://127.0.0.1:8080/other/subFeedback',
url: `${baseUrl}/other/subFeedback`,
data: {
title: this.data.title,
content: this.data.content,
time:TIME,
id:wx.getStorageSync('id')
time: TIME,
id: wx.getStorageSync('id')
},
success: function (d) {
if (d.data != "提交失败") {
@@ -38,11 +41,11 @@ Page({
icon: 'success',
duration: 2000,
success: function () {
setTimeout(function() {
setTimeout(function () {
wx.switchTab({
url: '../person/person'
})
}, 2000);
}, 2000);
}
})
} else {
@@ -56,8 +59,8 @@ Page({
})
},
onLoad: function(){
onLoad: function () {
},
});
});