kos/web/src/App.vue

72 lines
1.7 KiB
Vue

<template>
<NavBar />
<!-- router-view 定义在 router 文件夹的 index.js -->
<router-view></router-view>
</template>
<script>
// 导入 NavBar 组件
import NavBar from "./components/NavBar.vue";
// 导入 BootStrap 的 css 和 js 依赖以同步 BootStrap 样式
import "bootstrap/dist/css/bootstrap.css";
import "bootstrap/dist/js/bootstrap";
// import $ from "jquery";
export default {
components: { NavBar },
/* setup: () => {
$.ajax({
url: "http://localhost:3000/user/account/token/",
type: "POST",
data: {
username: "bb",
password: "pbb",
},
success(resp) {
console.log(resp.token, "\n成功了\n", resp.error_message);
},
error(resp) {
console.log(resp);
},
});
$.ajax({
url: "http://localhost:3000/user/account/info/",
type: "GET",
headers: {
Authorization:
"Bearer " +
"eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiIzODA2Yzc0ODkwYTE0NTgwYjcyOGQzOWI4NDYyYWY2ZSIsInN1YiI6IjYiLCJpc3MiOiJzZyIsImlhdCI6MTY3Njg4ODk5MywiZXhwIjoxNjc4MDk4NTkzfQ.mq7Xdt3G7VGvX7fgIYGN2MfH8bo9MuZ7V0nfzGmbDZ8",
},
success(resp) {
console.log(resp);
},
error(resp) {
console.log(resp);
},
});
$.ajax({
url: "http://localhost:3000/user/account/register/",
type: "POST",
data: {
username: "cc",
password: "pcc",
confirmedPassword: "pcc",
},
success(resp) {
console.log(resp);
},
error(resp) {
console.log(resp);
},
});
}, */
};
</script>
<style>
body {
/* 页面背景图片 */
background-image: url("@/assets/images/background.png");
background-size: cover;
}
</style>