|
|
@@ -32,22 +32,22 @@ export class ReviewComponent implements OnInit {
|
|
|
let currentUser = new CloudUser();
|
|
|
const userId = currentUser.toPointer();
|
|
|
|
|
|
- // 查询 User 表
|
|
|
- const quer = new Cloudmy('_User');
|
|
|
- quer.equalTo('objectId', userId);
|
|
|
+ // // 查询 User 表
|
|
|
+ // const quer = new Cloudmy('_User');
|
|
|
+ // quer.equalTo('objectId', userId);
|
|
|
|
|
|
- try {
|
|
|
- const latestuser = await quer.first(); // 等待 Promise 解析
|
|
|
+ // try {
|
|
|
+ // const latestuser = await quer.first(); // 等待 Promise 解析
|
|
|
|
|
|
- if (latestuser && latestuser.username) {
|
|
|
- this.data = latestuser.username;
|
|
|
- console.log('用户:', this.data);
|
|
|
- } else {
|
|
|
- console.log('没有找到 用户');
|
|
|
- }
|
|
|
- } catch (error) {
|
|
|
- console.error('查询_User时出错:', error);
|
|
|
- }
|
|
|
+ // if (latestuser && latestuser.username) {
|
|
|
+ // this.data = latestuser.username;
|
|
|
+ // console.log('用户:', this.data);
|
|
|
+ // } else {
|
|
|
+ // console.log('没有找到 用户');
|
|
|
+ // }
|
|
|
+ // } catch (error) {
|
|
|
+ // console.error('查询_User时出错:', error);
|
|
|
+ // }
|
|
|
|
|
|
let consult = new CloudObject("Review");
|
|
|
// 设置聊天记录的基本信息
|
|
|
@@ -64,7 +64,7 @@ export class ReviewComponent implements OnInit {
|
|
|
feedbackContent: this.userInput,
|
|
|
createdAt: dateStr, // 可以加上创建时间
|
|
|
star: this.currentScore,
|
|
|
- username:this.data,
|
|
|
+ username:currentUser?.get("username") || "-",
|
|
|
// ACL: ACL
|
|
|
});
|
|
|
|