|
@@ -4,56 +4,37 @@
|
|
|
<meta charset="UTF-8">
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
<title>Login and Registration</title>
|
|
|
- <link rel="stylesheet" href="//cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.2.2/css/bootstrap.min.css">
|
|
|
- <style>
|
|
|
- html, body {
|
|
|
- height: 100%;
|
|
|
- }
|
|
|
- body {
|
|
|
- display: flex;
|
|
|
- justify-content: center;
|
|
|
- align-items: center;
|
|
|
- }
|
|
|
- .container {
|
|
|
- width: 100%;
|
|
|
- max-width: 400px;
|
|
|
- }
|
|
|
- </style>
|
|
|
+
|
|
|
</head>
|
|
|
<body>
|
|
|
-<div class="container">
|
|
|
- <h1 class="text-center my-5">Login and Registration</h1>
|
|
|
- <form id="auth-form">
|
|
|
- <div class="mb-3">
|
|
|
- <label for="email" class="form-label">Email address</label>
|
|
|
- <input type="email" class="form-control" id="email">
|
|
|
- </div>
|
|
|
- <div class="mb-3">
|
|
|
- <label for="password" class="form-label">Password</label>
|
|
|
- <input type="password" class="form-control" id="password">
|
|
|
- </div>
|
|
|
- <div class="mb-3 form-check">
|
|
|
- <input type="checkbox" class="form-check-input" id="register-checkbox">
|
|
|
- <label class="form-check-label" for="register-checkbox">Register</label>
|
|
|
- </div>
|
|
|
- <button type="submit" class="btn btn-primary">Submit</button>
|
|
|
- </form>
|
|
|
-</div>
|
|
|
-<script src="//cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
|
|
|
-<script>
|
|
|
- const form = document.getElementById('auth-form');
|
|
|
- const registerCheckbox = document.getElementById('register-checkbox');
|
|
|
- form.addEventListener('submit', async (e) => {
|
|
|
- e.preventDefault();
|
|
|
- const email = document.getElementById('email').value;
|
|
|
- const password = document.getElementById('password').value;
|
|
|
- const url = registerCheckbox.checked ? '/register' : '/login';
|
|
|
- try {
|
|
|
- const response = await axios.post(url, { email, password });
|
|
|
- console.log(response);
|
|
|
- } catch (error) {
|
|
|
- console.error(error);
|
|
|
- }
|
|
|
+<!--https://aimp.aimpdev.k5.bigtree.tech/api/aimp-platform/out_api/processInvokeFile/jianbin_ocr-->
|
|
|
+<form method="post" action="https://aimp.btaimp.k7.bigtree.tech/api/aimp-platform/out_api/processInvokeFile/jianbin_ocr" enctype="multipart/form-data">
|
|
|
+ <label for="file">选择文件:</label>
|
|
|
+ <input type="file" id="file" name="file"><br><br>
|
|
|
+
|
|
|
+ <label for="queryNo">自定义参数queryNo:</label>
|
|
|
+ <input type="text" id="queryNo" name="queryNo"><br><br>
|
|
|
+
|
|
|
+ <input type="submit" value="上传">
|
|
|
+</form>
|
|
|
+
|
|
|
+<script type="text/javascript">
|
|
|
+ var form = document.querySelector('form');
|
|
|
+ form.addEventListener('submit', function(event) {
|
|
|
+ event.preventDefault(); // 阻止表单默认提交行为
|
|
|
+
|
|
|
+ var fileInput = document.getElementById('file');
|
|
|
+ var queryNoInput = document.getElementById('queryNo');
|
|
|
+
|
|
|
+ var formData = new FormData();
|
|
|
+ formData.append('file', fileInput.files[0]);
|
|
|
+ formData.append('queryNo', queryNoInput.value);
|
|
|
+
|
|
|
+ var xhr = new XMLHttpRequest();
|
|
|
+ xhr.open('POST', form.action);
|
|
|
+ xhr.setRequestHeader('appId', '85bbe16e29e240e89204f2951b894e84');
|
|
|
+ xhr.setRequestHeader('secret', 'VAhNW2iELMafYRJrHIKxxk_y4LM0ewmg');
|
|
|
+ xhr.send(formData);
|
|
|
});
|
|
|
</script>
|
|
|
</body>
|