-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
61 changed files
with
5,125 additions
and
1,232 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
docs/ | ||
example/ | ||
example/ | ||
admin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// 用户登录 | ||
export const login = async ( | ||
param:{ | ||
mobile:string, | ||
password:string, | ||
platform?:string | ||
}) => { | ||
let data = {} | ||
if (param.mobile && param.mobile) { | ||
data = { | ||
access_token: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJndWFyZCI6ImFwaSIsImlzcyI6ImltLndlYiIsImV4cCI6MTcyMTA3MDkwNCwiaWF0IjoxNjg1MDcwOTA0LCJqdGkiOiIyMDU0In0.-Mk4a20gur-QPxlYjgYc_eHWpWkDURJTawO0yBQ_b2g', | ||
expires_in: 36000000, | ||
type: 'Bearer', | ||
} | ||
} | ||
|
||
return data | ||
} | ||
|
||
// 退出登录 | ||
export const logout = async () => { | ||
return 'success' | ||
} | ||
|
||
// 刷新登录Token接口 | ||
export const refreshToken = async (token:string) => { | ||
return token | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,50 @@ | ||
import nedb from '../db/nedb.js' | ||
/* eslint-disable no-console */ | ||
/* eslint-disable camelcase */ | ||
import { ContactChat } from '../services/mod.js' | ||
|
||
const db:any = nedb('./contact.db') | ||
async function addUser (info:any) { | ||
try { | ||
const doc = await db.insert(info) | ||
return doc | ||
} catch (error) { | ||
// console.log('插入数据错误', error) | ||
// import { db } from '../db/tables.js' | ||
// const contactData = db.contact | ||
|
||
// 获取好友列表 | ||
export async function getContactList () { | ||
const contactListRaw:any = await ContactChat.findAll() | ||
// console.log('contactListRaw', JSON.stringify(contactListRaw)) | ||
const contactList: any = contactListRaw.map((value: { fields: { name: any; avatar: any; gender: any; id: any; alias: any }; recordId: any }) => { | ||
if (value.fields.name) { | ||
return { | ||
avatar: value.fields.avatar, | ||
gender: value.fields.gender, | ||
group_id: 0, | ||
id: value.fields.id, | ||
is_online: 0, | ||
motto: '', | ||
nickname: value.fields.name, | ||
remark: value.fields.alias, | ||
recordId: value.recordId, | ||
} | ||
} | ||
return false | ||
}).filter((item: boolean) => item !== false) | ||
const data = { | ||
items: contactList, | ||
} | ||
return data | ||
} | ||
async function getUser () { | ||
try { | ||
const search = await db.find({}) | ||
return search[0] | ||
} catch (error) { | ||
// console.log('查询数据错误', error) | ||
|
||
// 查询好友信息接口 | ||
export async function getContactInfo (_user_id:string) { | ||
const contactInfo:any = { | ||
avatar: '', | ||
email: 0, | ||
friend_apply: 0, | ||
friend_status: 1, | ||
gender: 0, | ||
group_id: 0, | ||
id: 4561, | ||
mobile: '17773011187', | ||
motto: '', | ||
nickname: '97', | ||
remark: '', | ||
} | ||
} | ||
export { addUser } | ||
export { getUser } | ||
export default { | ||
addUser, | ||
getUser, | ||
return contactInfo | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { GroupNoticeChat } from '../services/mod.js' | ||
// 获取群发通知列表 | ||
export const getGroupNoticeList = async (_data: any) => { | ||
const res = await GroupNoticeChat.db.findAll() | ||
return res | ||
} | ||
|
||
// 创建群发通知 | ||
export const createGroupNotice = (data: any) => { | ||
return data | ||
} | ||
|
||
// 删除群发通知 | ||
export const deleteGroupNotice = (data: any) => { | ||
return data | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { KeywordChat } from '../services/mod.js' | ||
// 获取关键词列表 | ||
export const getKeywordList = async (_params: any) => { | ||
const res = await KeywordChat.db.findAll() | ||
return res | ||
} | ||
|
||
// 获取关键词提示文案 | ||
export const getKeywordTips = (params: any) => { | ||
return params | ||
} |
Oops, something went wrong.