a1300399510@qq.com 提交于 2023/04/03 -12:00:02

This commit is contained in:
XiaoMo 2023-04-03 12:00:14 +08:00
parent 5a4bbd7df2
commit c64091d9c0
3 changed files with 10 additions and 3 deletions

View File

@ -184,7 +184,8 @@ export default {
//
getUserInfoData() {
this.$http.post("/widget/getUser").then((res) => {
// this.$http.post("/widget/getUser").then((res) => {
this.$http.post("/api",).then((res) => {
if (res.code != 200) return;
this.userInfo = res.data;
this.islogin = res.data.uid > 0 ? true : false;
@ -194,6 +195,7 @@ export default {
},
getMenu() {
return
this.$http.get("/widget", {
type: "menu",
}).then((res) => {

View File

@ -11,16 +11,19 @@ axios.defaults.withCredentials = true
axios.defaults.emulateJSON = true
// baseURL = "https://offer.gter.net/api"
baseURL = "https://forum.gter.net"
console.log("baseURL",baseURL);
const service = axios.create({
baseURL,
timeout: 5000
})
// service.header.authorization = "qj2q1qk1on0curclipghjtv5ja1g9eq2"
// 2.请求拦截器
service.interceptors.request.use(config => {
//发请求前做的一些处理数据转化配置请求头设置token,设置loading等根据需求去添加
//注意使用token的时候需要引入cookie方法或者用本地localStorage等方法推荐js-cookie
// console.log(config, "config");
config['headers']['authorization'] = "qj2q1qk1on0curclipghjtv5ja1g9eq2"
return config
}, error => {
Promise.reject(error)

View File

@ -7,7 +7,7 @@
</div>
<!-- 右选项 -->
<div class="allSections-right">
<div class="allSections-right-item" v-for="(i, k) in showList" :key="k">
<div class="allSections-right-item" v-for="(i, k) in list[allActive].data" :key="k">
<div class="item-content">
<div class="item-title">{{ i.name }}</div>
<div v-if="i.description" class="item-text" v-html="i.description"></div>
@ -65,6 +65,8 @@ export default {
this.$http.post("/api/home/allForum").then((res) => {
if (res.code != 200) return;
this.list = res.data
console.log(this.list, "list");
}).catch(err => {
this.$message.error(err.message)
});