Skip to content

Commit befa80f

Browse files
committed
update
1 parent 0adb5a0 commit befa80f

File tree

5 files changed

+9
-13
lines changed

5 files changed

+9
-13
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ Vue全家桶+Socket.io+Express/Koa2打造的网页版手机QQ(web app),高仿手
99

1010
三个测试账号如下:
1111

12-
* qq:986992484 密码:111111
12+
* qq:986992484 密码:111111 (对应昵称是莫知我哀----宇文玥)
1313

14-
* qq:986992483 密码:111111
14+
* qq:986992483 密码:111111 (对应昵称是浅唱低吟----楚乔)
1515

16-
* qq:986992482 密码:111111
16+
* qq:986992482 密码:111111 (对应昵称是以梦之铭----马哲涵)
1717

1818
## 技术栈
1919
* **Vue2.0**:实现前端页面构建
@@ -32,7 +32,7 @@ Vue全家桶+Socket.io+Express/Koa2打造的网页版手机QQ(web app),高仿手
3232
* **IScroll**:模拟原生app的列表滚动效果(ListView)
3333
* **MySQL**:MySQL关系型数据库持久化数据(考虑到表与表之间关系复杂,需要多表查询,最复杂的时候是六张表联查,用MySQL会比Mongodb好得多)
3434
* **jsonp**:跨域请求数据
35-
* **pm2**:服务端使用pm2部署,常驻进程,比forever好用得多(https://github.com/Unitech/pm2)
35+
* **pm2**:服务端使用pm2部署,常驻进程,比forever好用得多(https://github.com/Unitech/pm2
3636
* **nginx**:服务端使用nginx代理端口转发
3737

3838
## 使用方式

server/common/mysql/db.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const pool = mysql.createPool({
44
host: 'localhost',
55
user: 'root',
66
password: '',
7-
database: 'qq'
7+
database: 'qq1'
88
})
99

1010
export default (sql, values) => {

server/controller/user/index.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,11 @@ export default class User {
143143
//根据真实ip地址获取城市名称
144144
const {data} = await request_get(`http://ip.taobao.com/service/getIpInfo.php?ip=${ip}`)
145145
const city = data.city.substring(0, data.city.length - 1)
146-
147-
//获取温度
148-
const weather = await request_get(`http://v.juhe.cn/weather/index?format=2&cityname=
149-
${encodeURIComponent(city)}&key=075b8c5b264a4a4b17088449b905bd70`)
150146
return {
151147
code: 200,
152148
data: {
153149
city,
154-
temperature: weather.result.sk.temp
150+
temperature: 21
155151
}
156152
}
157153
}

src/store/modules/friend.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ const actions = {
5050
//状态一样的情况下再按VIP级别排序
5151
if ((prev.status > 0 && current.status > 0) || (prev.status == 0 &&
5252
current.status == 0)){
53-
return prev.vip < current.vip
53+
return current.vip - prev.vip
5454
}
5555
//否则不排序
5656
return false
5757
})
5858
//按角色升序排列
5959
groupData.sort((prev, current) => {
60-
return prev.role > current.role
60+
return prev.role - current.role
6161
})
6262

6363
//先将好友数据转换成指定格式

src/store/modules/message.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ const actions = {
6262
}
6363
const allMessage = singleMessage.concat(groupMessage)
6464
allMessage.sort((prev, current) => { //按时间降序排列
65-
return prev.time < current.time
65+
return current.time - prev.time
6666
})
6767
for (let [index, value] of allMessage.entries()) {
6868
allMessage[index]['time'] = parseMessageTime(value.time) //解析时间

0 commit comments

Comments
 (0)