File tree Expand file tree Collapse file tree 5 files changed +9
-13
lines changed Expand file tree Collapse file tree 5 files changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -9,11 +9,11 @@ Vue全家桶+Socket.io+Express/Koa2打造的网页版手机QQ(web app),高仿手
9
9
10
10
三个测试账号如下:
11
11
12
- * qq:986992484 密码:111111
12
+ * qq:986992484 密码:111111 (对应昵称是莫知我哀----宇文玥)
13
13
14
- * qq:986992483 密码:111111
14
+ * qq:986992483 密码:111111 (对应昵称是浅唱低吟----楚乔)
15
15
16
- * qq:986992482 密码:111111
16
+ * qq:986992482 密码:111111 (对应昵称是以梦之铭----马哲涵)
17
17
18
18
## 技术栈
19
19
* ** Vue2.0** :实现前端页面构建
@@ -32,7 +32,7 @@ Vue全家桶+Socket.io+Express/Koa2打造的网页版手机QQ(web app),高仿手
32
32
* ** IScroll** :模拟原生app的列表滚动效果(ListView)
33
33
* ** MySQL** :MySQL关系型数据库持久化数据(考虑到表与表之间关系复杂,需要多表查询,最复杂的时候是六张表联查,用MySQL会比Mongodb好得多)
34
34
* ** jsonp** :跨域请求数据
35
- * ** pm2** :服务端使用pm2部署,常驻进程,比forever好用得多(https://github.com/Unitech/pm2)
35
+ * ** pm2** :服务端使用pm2部署,常驻进程,比forever好用得多(https://github.com/Unitech/pm2 )
36
36
* ** nginx** :服务端使用nginx代理端口转发
37
37
38
38
## 使用方式
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ const pool = mysql.createPool({
4
4
host : 'localhost' ,
5
5
user : 'root' ,
6
6
password : '' ,
7
- database : 'qq '
7
+ database : 'qq1 '
8
8
} )
9
9
10
10
export default ( sql , values ) => {
Original file line number Diff line number Diff line change @@ -143,15 +143,11 @@ export default class User {
143
143
//根据真实ip地址获取城市名称
144
144
const { data} = await request_get ( `http://ip.taobao.com/service/getIpInfo.php?ip=${ ip } ` )
145
145
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` )
150
146
return {
151
147
code : 200 ,
152
148
data : {
153
149
city,
154
- temperature : weather . result . sk . temp
150
+ temperature : 21
155
151
}
156
152
}
157
153
}
Original file line number Diff line number Diff line change @@ -50,14 +50,14 @@ const actions = {
50
50
//状态一样的情况下再按VIP级别排序
51
51
if ( ( prev . status > 0 && current . status > 0 ) || ( prev . status == 0 &&
52
52
current . status == 0 ) ) {
53
- return prev . vip < current . vip
53
+ return current . vip - prev . vip
54
54
}
55
55
//否则不排序
56
56
return false
57
57
} )
58
58
//按角色升序排列
59
59
groupData . sort ( ( prev , current ) => {
60
- return prev . role > current . role
60
+ return prev . role - current . role
61
61
} )
62
62
63
63
//先将好友数据转换成指定格式
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ const actions = {
62
62
}
63
63
const allMessage = singleMessage . concat ( groupMessage )
64
64
allMessage . sort ( ( prev , current ) => { //按时间降序排列
65
- return prev . time < current . time
65
+ return current . time - prev . time
66
66
} )
67
67
for ( let [ index , value ] of allMessage . entries ( ) ) {
68
68
allMessage [ index ] [ 'time' ] = parseMessageTime ( value . time ) //解析时间
You can’t perform that action at this time.
0 commit comments