修复没有名字
This commit is contained in:
parent
d0bca860a3
commit
cce9e3cb52
12
apis/user.js
12
apis/user.js
|
@ -54,4 +54,16 @@ export const updateUserName=(username)=>{
|
||||||
username,
|
username,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取用户昵称
|
||||||
|
*/
|
||||||
|
export const getUserNameById=(id)=>{
|
||||||
|
return http({
|
||||||
|
url:"/api/getUserNameById",
|
||||||
|
method:"GET",
|
||||||
|
data:{
|
||||||
|
id,
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
|
@ -53,7 +53,7 @@
|
||||||
import { reactive, ref } from 'vue';
|
import { reactive, ref } from 'vue';
|
||||||
import { onLoad } from "@dcloudio/uni-app";
|
import { onLoad } from "@dcloudio/uni-app";
|
||||||
import { getCastInfo } from '@/apis/cast.js';
|
import { getCastInfo } from '@/apis/cast.js';
|
||||||
import { getImageById } from '@/apis/user.js';
|
import { getImageById ,getUserNameById} from '@/apis/user.js';
|
||||||
import { getCommentsByRelatedPostId, addComments } from '@/apis/comments.js';
|
import { getCommentsByRelatedPostId, addComments } from '@/apis/comments.js';
|
||||||
import { addLike } from '@/apis/likes.js';
|
import { addLike } from '@/apis/likes.js';
|
||||||
import { addCollections } from "@/apis/collections.js";
|
import { addCollections } from "@/apis/collections.js";
|
||||||
|
@ -129,8 +129,10 @@ const getData = async () => {
|
||||||
com = com.data;
|
com = com.data;
|
||||||
let list = await getCommentsByRelatedPostId(id.value);
|
let list = await getCommentsByRelatedPostId(id.value);
|
||||||
let image = await getImageById(com.userId);
|
let image = await getImageById(com.userId);
|
||||||
|
let userName=await getUserNameById(com.userId)
|
||||||
list = list.data;
|
list = list.data;
|
||||||
commentList.value = list;
|
commentList.value = list;
|
||||||
|
info.name=userName.msg;
|
||||||
info.iamge = image.msg;
|
info.iamge = image.msg;
|
||||||
info.caseId = com.caseId;
|
info.caseId = com.caseId;
|
||||||
info.title = com.title;
|
info.title = com.title;
|
||||||
|
|
|
@ -36,7 +36,17 @@ const updateUserName = (username) => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
const getUserNameById = (id) => {
|
||||||
|
return utils_http.http({
|
||||||
|
url: "/api/getUserNameById",
|
||||||
|
method: "GET",
|
||||||
|
data: {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
exports.getImageById = getImageById;
|
exports.getImageById = getImageById;
|
||||||
|
exports.getUserNameById = getUserNameById;
|
||||||
exports.mark = mark;
|
exports.mark = mark;
|
||||||
exports.updateUserImage = updateUserImage;
|
exports.updateUserImage = updateUserImage;
|
||||||
exports.updateUserName = updateUserName;
|
exports.updateUserName = updateUserName;
|
||||||
|
|
|
@ -90,8 +90,10 @@ const _sfc_main = {
|
||||||
com = com.data;
|
com = com.data;
|
||||||
let list = await apis_comments.getCommentsByRelatedPostId(id.value);
|
let list = await apis_comments.getCommentsByRelatedPostId(id.value);
|
||||||
let image = await apis_user.getImageById(com.userId);
|
let image = await apis_user.getImageById(com.userId);
|
||||||
|
let userName = await apis_user.getUserNameById(com.userId);
|
||||||
list = list.data;
|
list = list.data;
|
||||||
commentList.value = list;
|
commentList.value = list;
|
||||||
|
info.name = userName.msg;
|
||||||
info.iamge = image.msg;
|
info.iamge = image.msg;
|
||||||
info.caseId = com.caseId;
|
info.caseId = com.caseId;
|
||||||
info.title = com.title;
|
info.title = com.title;
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
|
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
|
||||||
"projectname": "gree_leran",
|
"projectname": "gree_leran",
|
||||||
"setting": {
|
"setting": {
|
||||||
"compileHotReLoad": true
|
"compileHotReLoad": true,
|
||||||
|
"urlCheck": false
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
const common_vendor = require("../common/vendor.js");
|
const common_vendor = require("../common/vendor.js");
|
||||||
const utils_Auth = require("./Auth.js");
|
const utils_Auth = require("./Auth.js");
|
||||||
const baseUrl = "https://9miao.fun/prod-api";
|
const baseUrl = "http://127.0.0.1:8080";
|
||||||
const http = (option) => {
|
const http = (option) => {
|
||||||
if (!option instanceof Object) {
|
if (!option instanceof Object) {
|
||||||
throw "参数非法";
|
throw "参数非法";
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
import {
|
import {
|
||||||
getToken
|
getToken
|
||||||
} from "./Auth.js"
|
} from "./Auth.js"
|
||||||
export const baseUrl = "https://9miao.fun/prod-api"
|
// export const baseUrl = "https://9miao.fun/prod-api"
|
||||||
// export const baseUrl="http://127.0.0.1:8080"
|
export const baseUrl="http://127.0.0.1:8080"
|
||||||
|
|
||||||
|
|
||||||
export const http = (option) => {
|
export const http = (option) => {
|
||||||
|
|
Loading…
Reference in New Issue