Initial Commit
This commit is contained in:
commit
1d71a02738
237 changed files with 64293 additions and 0 deletions
35
test-feedback.js
Normal file
35
test-feedback.js
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
// 测试反馈提交功能
|
||||
const ApiClient = require('./utils/api-client.js');
|
||||
|
||||
// 创建测试函数
|
||||
async function testFeedbackSubmission() {
|
||||
console.log('开始测试反馈提交功能...');
|
||||
|
||||
// 初始化API客户端
|
||||
const apiClient = new ApiClient();
|
||||
|
||||
try {
|
||||
// 模拟提交反馈
|
||||
const testFeedback = '这是一个测试反馈内容,用于验证提交功能。';
|
||||
console.log(`提交反馈: ${testFeedback}`);
|
||||
|
||||
const response = await apiClient.post('/api/v1/user/feedback', {
|
||||
content: testFeedback,
|
||||
type: 'suggestion',
|
||||
source: 'miniprogram'
|
||||
});
|
||||
|
||||
console.log('反馈提交成功!', response);
|
||||
return { success: true, response };
|
||||
} catch (error) {
|
||||
console.error('反馈提交失败!', error);
|
||||
return { success: false, error: error.message };
|
||||
}
|
||||
}
|
||||
|
||||
// 执行测试
|
||||
if (require.main === module) {
|
||||
testFeedbackSubmission();
|
||||
}
|
||||
|
||||
module.exports = { testFeedbackSubmission };
|
||||
Loading…
Add table
Add a link
Reference in a new issue