Merge branch 'feature-nxdev' of https://gitea.nxsir.cn/code/IM into feature-nxdev
This commit is contained in:
commit
3b126f17fc
@ -53,6 +53,7 @@ namespace IM_API.Controllers
|
||||
return Ok(res);
|
||||
}
|
||||
[HttpPost]
|
||||
[ProducesResponseType(typeof(BaseResponse<LoginDto>),StatusCodes.Status200OK)]
|
||||
public async Task<IActionResult> Refresh(RefreshDto dto)
|
||||
{
|
||||
(bool ok,int userId) = await _refreshTokenService.ValidateRefreshTokenAsync(dto.refreshToken);
|
||||
|
||||
@ -13,5 +13,11 @@ export const authService = {
|
||||
* @param {*} data
|
||||
* @returns
|
||||
*/
|
||||
register: (data) => request.post('/auth/register', data)
|
||||
register: (data) => request.post('/auth/register', data),
|
||||
/**
|
||||
* 刷新用户凭证
|
||||
* @param {*} data
|
||||
* @returns
|
||||
*/
|
||||
refresh: (refreshToken) => request.post('/auth/refresh', { refreshToken })
|
||||
}
|
||||
@ -30,9 +30,9 @@
|
||||
class="list-item"
|
||||
:class="{active: activeContactId === c.id}"
|
||||
@click="activeContactId = c.id">
|
||||
<img :src="c.avatar" class="avatar-std" />
|
||||
<img :src="c.userInfo.avatar" class="avatar-std" />
|
||||
<div class="info">
|
||||
<div class="name">{{ c.name }}</div>
|
||||
<div class="name">{{ c.remarkName }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -43,21 +43,21 @@
|
||||
<header class="profile-header">
|
||||
<div class="text-info">
|
||||
<h2 class="display-name">
|
||||
{{ currentContact.name }}
|
||||
<span :class="['gender-tag', currentContact.gender]">
|
||||
{{ currentContact.gender === 'm' ? '♂' : '♀' }}
|
||||
{{ currentContact.remarkName }}
|
||||
<span :class="['gender-tag', 'm']">
|
||||
{{ '♂' }}
|
||||
</span>
|
||||
</h2>
|
||||
<p class="sub-text">微信号:{{ currentContact.wxid }}</p>
|
||||
<p class="sub-text">地区:{{ currentContact.region }}</p>
|
||||
<p class="sub-text">账号:{{ currentContact.userInfo.username }}</p>
|
||||
<p class="sub-text">地区:{{ '未知' }}</p>
|
||||
</div>
|
||||
<img :src="currentContact.avatar" class="big-avatar" />
|
||||
<img :src="currentContact.userInfo.avatar" class="big-avatar" />
|
||||
</header>
|
||||
|
||||
<div class="profile-body">
|
||||
<div class="info-row">
|
||||
<span class="label">备注名</span>
|
||||
<span class="value">{{ currentContact.alias || '未设置' }}</span>
|
||||
<span class="label">昵称</span>
|
||||
<span class="value">{{ currentContact.userInfo.nickName }}</span>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="label">个性签名</span>
|
||||
@ -65,7 +65,7 @@
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="label">来源</span>
|
||||
<span class="value">通过搜索微信号添加</span>
|
||||
<span class="value">通过搜索账号添加</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -91,20 +91,24 @@ import { friendService } from '@/services/friend'
|
||||
const searchQuery = ref('')
|
||||
const activeContactId = ref(null)
|
||||
|
||||
const contacts1 = ref([]);
|
||||
const contacts = ref([]);
|
||||
|
||||
// 模拟联系人数据
|
||||
const contacts = ref([
|
||||
{ id: 1, name: '南浔', wxid: 'nan_xun_99', region: '浙江 杭州', avatar: 'https://i.pravatar.cc/40?1', gender: 'f', signature: '山有木兮木有枝', alias: '南酱' },
|
||||
{ id: 102, name: '老张', wxid: 'zhang_boss', region: '广东 深圳', avatar: 'https://i.pravatar.cc/40?10', gender: 'm', signature: '搞钱要紧', alias: '张总' },
|
||||
{ id: 103, name: 'UI小王', wxid: 'wang_design', region: '上海 黄浦', avatar: 'https://i.pravatar.cc/40?5', gender: 'f', signature: '不改了,真的不改了', alias: '' },
|
||||
{ id: 104, name: '测试组长', wxid: 'test_pro', region: '北京', avatar: 'https://i.pravatar.cc/40?8', gender: 'm', signature: 'Bug 哪里跑', alias: '铁面人' }
|
||||
])
|
||||
|
||||
const filteredContacts = computed(() => {
|
||||
return contacts.value.filter(c =>
|
||||
c.name.includes(searchQuery.value) || c.wxid.includes(searchQuery.value)
|
||||
)
|
||||
const searchKey = searchQuery.value.toString().trim();
|
||||
if(!searchKey){
|
||||
return contacts.value;
|
||||
}
|
||||
|
||||
|
||||
return contacts.value.filter(c => {
|
||||
if (!c) return false
|
||||
|
||||
const remark = c.remarkName || ''
|
||||
const username = c.userInfo.username || ''
|
||||
|
||||
return remark.includes(searchKey) || username.includes(searchKey)
|
||||
})
|
||||
})
|
||||
|
||||
const currentContact = computed(() => {
|
||||
@ -121,15 +125,14 @@ function handleGoToChat() {
|
||||
|
||||
const loadContactList = async (page = 1,limit = 100) => {
|
||||
const res = await friendService.getFriendList(page,limit);
|
||||
contacts1.value = res.data;
|
||||
contacts.value = res.data;
|
||||
console.log(contacts.value)
|
||||
}
|
||||
|
||||
|
||||
|
||||
onMounted(async () => {
|
||||
await loadContactList();
|
||||
const contacts = await friendService.getFriendList();
|
||||
console.log(contacts)
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user