前端完成对接

FRONT_a
helloworld180 1 month ago
parent a377375030
commit 862c067419

Binary file not shown.

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="icon" href="/点名.svg">
<link rel="icon" href="/点名.png">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>点点小助手</title>
</head>

Binary file not shown.

After

Width:  |  Height:  |  Size: 649 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 909 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 1.2 MiB

@ -4,7 +4,7 @@ import {getToken} from '@/token/auth' // 注意这里使用了解构赋值来导
// 创建axios实例
const service = axios.create({
baseURL: ' http://p4ue3i.natappfree.cc/api', // 配置基础URL
baseURL: 'http://hup3hr.natappfree.cc/api', // 配置基础URL
timeout: 5000, // 请求超时时间
});
@ -13,7 +13,7 @@ service.interceptors.request.use(
config => {
// 在发送请求之前做些什么
const token = getToken(); // 获取token的方式取决于你的应用
console.log('请求拦截器的token是' +token)
// console.log('请求拦截器的token是' +token)
console.log('Request Config:', config);
if (token) {
config.headers['Authorization'] = `Bearer ${token}`; // 设置token

@ -56,7 +56,8 @@ import { ref } from 'vue';
console.log('实际接收到的数据:', response.data);
}
if (this.names.length === 0 || this.names.every(name => name.trim() === '')) {
alert('后端传回的字符串数组全为空');
alert('请先导入学生名单');
this.back()
//
// this.names = ['1', '2']; //
return; //

@ -3,6 +3,8 @@
<div class="content">
<!-- 展示区 -->
<div class="leftIcon">
<div class="text-style">点点小助手</div>
<img src="../assets/image/left-icon.svg" alt="" class="dian-icon">
<RouterView></RouterView>
</div>
<!-- 导航栏 -->
@ -89,6 +91,21 @@ export default {
height: 800px;
/* background-color: red; */
}
.dian-icon {
position: absolute;
width: 690px;
/* top: 35%; */
left: 6%;
bottom: 5%;
}
.text-style {
position: absolute;
top: 4%;
left: 5%;
font-size: 73px;
font-weight: bold;
color: #8755F2;
}
.selectItem {
padding: 25px 130px;
border-radius: 50px;

@ -87,7 +87,7 @@ const customUpload = (options) => {
formData.append('file', file);
console.log('formData是' + formData)
axios.post('http://p4ue3i.natappfree.cc/api/students/import', formData, {
axios.post('/students/import', formData, {
headers: {
'Content-Type': 'multipart/form-data'
}

@ -91,7 +91,7 @@
<img src="../assets/image/password.png" alt="" class="input-icon">
<input
v-model="registerForm.confirmPassword"
:type="showConfirmPassword ? 'text' : 'password'"
:type="showPassword ? 'text' : 'password'"
placeholder="再次确认密码"
>
<img src="../assets/image/eye.png"
@ -156,7 +156,7 @@
const token = response.token;
// token
setToken(token);
console.log( 'token是' + getToken() )
// console.log( 'token' + getToken() )
//
@ -181,6 +181,7 @@
}
});
//
alert('注册成功');
console.log('注册成功', response);
} catch (error) {
//

@ -164,7 +164,12 @@
// const response = await axios.post('/students/${this.studentId}/adjustPoints', pointsDelta)
await axios.put(`/students/${this.studentId}/adjustPoints`, {
pointsDelta: pointsDelta
},{
headers: {
'Content-Type': 'application/json'
}
});
console.log(this.studentId)
alert('积分调整成功');
this.close();
} catch (error) {

Loading…
Cancel
Save