54 lines
1.0 KiB
Vue
54 lines
1.0 KiB
Vue
<template>
|
|
<view>
|
|
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
data() {
|
|
return {
|
|
notice:null
|
|
}
|
|
},
|
|
methods: {
|
|
async request(gest, path) {
|
|
let text
|
|
if (gest == "get") {
|
|
text = await fetch(`http://124.93.196.45:10091/Neusoft/community${path}`, {
|
|
method: "GET",
|
|
headers: {
|
|
"Content-Type": "application/json",
|
|
"Authorization":(await this.request("post","/api/login")).token
|
|
},
|
|
})
|
|
}
|
|
else if (gest=="post"){
|
|
text = await fetch(`http://124.93.196.45:10091/Neusoft/community${path}`,{
|
|
method:"POST",
|
|
headers:{
|
|
"Content-Type": "application/json",
|
|
},
|
|
body: JSON.stringify({
|
|
"password": "0CYdq6Hn",
|
|
"username": "6dOMIgIU",
|
|
})
|
|
})
|
|
}
|
|
const data = await text.json()
|
|
console.log(data)
|
|
return data
|
|
}
|
|
},
|
|
async mounted(){
|
|
// await this.request("get","/api/notice/list")
|
|
// await this.request("get","/api/cms/article/list")
|
|
// await this.request("get","/api/visitor/list")
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
|
|
</style>
|