Skip to content

Commit

Permalink
问卷
Browse files Browse the repository at this point in the history
  • Loading branch information
tjw2003 committed Apr 8, 2024
1 parent c8ea063 commit 42fc281
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions backend.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# -*- coding: utf-8 -*-

from flask import Flask, request, jsonify
from flask_cors import CORS

app = Flask(__name__)
CORS(app, resources={r"/*": {"origins": "*"}}) # 允许所有来源的请求访问你的应用

# 预定义的APIKEY
PREDEFINED_APIKEY = "DBUICFAOIUDFBASDBNFAI"
Expand Down
5 changes: 2 additions & 3 deletions src/views/Questions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,12 @@ export default {
methods: {
submitQuestionnaire() {
// 收集用户的回答
const answers = this.responses;
// 可以在这里将答案发送到后端或进行其他处理
const answers = this.responses.map(response => parseInt(response, 10));
console.log('用户的答案:', answers);
// 构建请求数据
const requestData = {
"APIKEY": "DBUICFAOIUDFBASDBNFAI", // 固定的 APIKEY
"USERID": "1", // 这里假设 USERID 是固定值 "1",实际应该根据登录用户的信息设置
"USERID": "1",
"answers": answers
};
Expand Down

0 comments on commit 42fc281

Please sign in to comment.