This commit is contained in:
nopy 2024-07-10 13:58:30 +08:00
parent 039ab49b0a
commit ba7e87eb6a
3 changed files with 29 additions and 29 deletions

View File

@ -4,7 +4,7 @@ module.exports = function(app) {
app.use( app.use(
'/api', // 如果请求路径匹配'/api',则进行代理 '/api', // 如果请求路径匹配'/api',则进行代理
createProxyMiddleware({ createProxyMiddleware({
target: 'http://36.138.114.105:31055/', // 目标后端服务地址 target: 'http://127.0.0.1:5000s', // 目标后端服务地址
changeOrigin: true, changeOrigin: true,
}) })
); );

View File

@ -6,7 +6,7 @@ import paramiko
from teacher_func import * from teacher_func import *
from student_func import * from student_func import *
from k8s_func import * # from k8s_func import *
from flask import Flask, render_template, request, jsonify, send_from_directory, session from flask import Flask, render_template, request, jsonify, send_from_directory, session
from flask_cors import CORS from flask_cors import CORS
@ -331,32 +331,32 @@ def appendQuestion():
@app.route("/api/teacher/list_pods",methods=['POST']) # 列出pod # @app.route("/api/teacher/list_pods",methods=['POST']) # 列出pod
def teacher_list_pods(): # def teacher_list_pods():
return list_pods() # return list_pods()
@app.route("/api/teacher/list_services") # 列出服务 # @app.route("/api/teacher/list_services") # 列出服务
def teacher_list_services(): # def teacher_list_services():
return list_services() # return list_services()
#
# @app.route("/api/teacher/create_pod") # 创建服务 1为项目实训 0为安装实训 # # @app.route("/api/teacher/create_pod") # 创建服务 1为项目实训 0为安装实训
# def teacher_create_pod(): # # def teacher_create_pod():
# create_pod(1, "test2") # # create_pod(1, "test2")
#
@app.route("/api/teacher/DelPods",methods=['POST']) # 删除服务 # @app.route("/api/teacher/DelPods",methods=['POST']) # 删除服务
def teacher_delete_pod(): # def teacher_delete_pod():
name=request.json['name'] # name=request.json['name']
studentID=name[1:9] # studentID=name[1:9]
testID=name[10:] # testID=name[10:]
delDMFunc(studentID,testID) # delDMFunc(studentID,testID)
return delete_pod(name=name) # return delete_pod(name=name)
#
@app.route("/api/student/check_pod",methods=['POST']) # 检测数据库是否安装成功 若成功返回OK 否则返回NO # @app.route("/api/student/check_pod",methods=['POST']) # 检测数据库是否安装成功 若成功返回OK 否则返回NO
def teacher_check_pod(): # def teacher_check_pod():
name=request.json["student_ID"] # name=request.json["student_ID"]
testID=request.json["operateID"] # testID=request.json["operateID"]
name= 'n' + str(name) + '-' + str(testID) # name= 'n' + str(name) + '-' + str(testID)
result = check_dm(name) # result = check_dm(name)
return jsonify(result) # return jsonify(result)
@app.route('/') @app.route('/')
@app.route('/<path:path>') @app.route('/<path:path>')

View File

@ -4,7 +4,7 @@ from Crypto.Cipher import AES
from Crypto.Random import get_random_bytes from Crypto.Random import get_random_bytes
import base64 import base64
import datetime import datetime
import k8s_func # import k8s_func
db = dmPython.connect(user='SYSDBA', password='dameng!!', host="36.138.114.105", port="32522") db = dmPython.connect(user='SYSDBA', password='dameng!!', host="36.138.114.105", port="32522")