feat: 功能组件添加
新增axios请求组件http.js,新增国际化组件i18n.js,新增完全分页组件pagination,样式调整
This commit is contained in:
41
nezha-fronted/src/components/common/login.vue
Normal file
41
nezha-fronted/src/components/common/login.vue
Normal file
@@ -0,0 +1,41 @@
|
||||
<template>
|
||||
<div>
|
||||
<div>登录</div>
|
||||
<el-input v-model="loginData.username" placeholder="请输入内容"></el-input>
|
||||
<el-input v-model="loginData.password" placeholder="请输入内容"></el-input>
|
||||
<button @click="login">登录</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "login",
|
||||
data() {
|
||||
return {
|
||||
loginData: {
|
||||
username: '',
|
||||
password: '',
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
login() {
|
||||
this.$post('api/sys/login', (this.loginData)).then(res => {
|
||||
if (res.code == 200) {
|
||||
sessionStorage.setItem("token", res.data.token);
|
||||
this.$router.push({
|
||||
path: "/asset",
|
||||
query: {
|
||||
t: +new Date()
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user