.
110
apidoc.html
Normal file
1
apidoc.json
Normal file
@ -3,7 +3,7 @@
|
||||
<application port="5002">
|
||||
<resources>
|
||||
<source name="redis" value="org.redkalex.cache.RedisCacheSource" xxx="16">
|
||||
<node addr="redishost" port="6379" password="pwd123"/>
|
||||
<node addr="redishost" port="6379" password="hello"/>
|
||||
</source>
|
||||
|
||||
<properties load="conf.txt">
|
||||
|
@ -5,9 +5,14 @@
|
||||
<persistence-unit name="redbbs" transaction-type="RESOURCE_LOCAL">
|
||||
<shared-cache-mode>ALL</shared-cache-mode>
|
||||
<properties>
|
||||
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://mysqlhost:3306/?autoReconnect=true&characterEncoding=utf8"/>
|
||||
<property name="javax.persistence.jdbc.user" value="guest"/>
|
||||
<property name="javax.persistence.jdbc.password" value="hello"/>
|
||||
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://558cfc37a10ef.sh.cdb.myqcloud.com:3817/?autoReconnect=true&characterEncoding=utf8&useSSL=true"/>
|
||||
<property name="javax.persistence.jdbc.driver" value="com.mysql.cj.jdbc.Driver"/>
|
||||
<property name="javax.persistence.jdbc.user" value="cdb_outerroot"/>
|
||||
<property name="javax.persistence.jdbc.password" value="l237809796"/>
|
||||
<!--<property name="javax.persistence.jdbc.url" value="jdbc:mysql://mysqlhost:3306/?autoReconnect=true&characterEncoding=utf8"/>
|
||||
<property name="javax.persistence.jdbc.driver" value="com.mysql.cj.jdbc.Driver"/>
|
||||
<property name="javax.persistence.jdbc.user" value="root"/>
|
||||
<property name="javax.persistence.jdbc.password" value="*hello9796!"/>-->
|
||||
</properties>
|
||||
</persistence-unit>
|
||||
|
||||
|
BIN
lib/redkale-plugins.jar
Normal file
BIN
lib/redkale.jar
Normal file
BIN
libs/redbbs.jar
Normal file
1
pom.xml
@ -8,7 +8,6 @@
|
||||
<artifactId>redbbs</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<build>
|
||||
<finalName>redbbs</finalName>
|
||||
<sourceDirectory>src</sourceDirectory>
|
||||
<plugins>
|
||||
<plugin>
|
||||
|
19
root/404.html
Normal file
@ -0,0 +1,19 @@
|
||||
<!--- Created by JUECHENG at 2018/7/27 11:42. --->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>404</title>
|
||||
</head>
|
||||
<body style="padding: 50px">
|
||||
<h1>由于网站被攻击,已暂停访问</h1>
|
||||
<p>
|
||||
黑客把数据全部清空了,数据库有半个月没做备案了(失误),但是有所有一切操作的日志记录,
|
||||
包括黑客的攻击数据,ip,当然也有这十多天的文章提交数据,所以理论上,所有数据能够恢复,
|
||||
待恢复后再开做开放访问;谢谢你的关注和支持;
|
||||
</p>
|
||||
<p>
|
||||
----------- 绝尘,QQ237809796
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
@ -127,6 +127,286 @@
|
||||
<script src="/res/layui/layui.js"></script>
|
||||
#@js?()
|
||||
|
||||
<!--layim-->
|
||||
<script>
|
||||
|
||||
if(!/^http(s*):\/\//.test(location.href)){
|
||||
alert('请部署到localhost上查看该演示');
|
||||
}
|
||||
|
||||
layui.use('layim', function(layim){
|
||||
var $ = layui.jquery;//www.1216.top
|
||||
var target = 'ws://127.0.0.1/os/ws/chat?token=#(token)';
|
||||
|
||||
var ws;
|
||||
if ('WebSocket' in window) {
|
||||
ws = new WebSocket(target);
|
||||
} else if ('MozWebSocket' in window) {
|
||||
ws = new MozWebSocket(target);
|
||||
} else {
|
||||
alert('WebSocket is not supported by this browser.');
|
||||
return;
|
||||
}
|
||||
|
||||
ws.onopen = function () {
|
||||
console.log('Info: WebSocket connection opened.');
|
||||
};
|
||||
|
||||
//接收信息
|
||||
ws.onmessage = function (event) {
|
||||
console.log(event);
|
||||
var data = eval("("+event.data+")");
|
||||
layim.getMessage(data);
|
||||
//flashTitle();
|
||||
};
|
||||
ws.onclose = function (event) {
|
||||
console.log('Info: WebSocket connection closed, Code: ' + event.code + (event.reason == "" ? "" : ", Reason: " + event.reason));
|
||||
};
|
||||
|
||||
//监听发送消息
|
||||
layim.on('sendMessage', function(data){
|
||||
//发送消息倒Socket服务
|
||||
var msg = {
|
||||
text:{
|
||||
msg:{
|
||||
touserid:data.to.id
|
||||
,content:data.mine.content
|
||||
}
|
||||
}
|
||||
};
|
||||
ws.send(JSON.stringify(msg));
|
||||
});
|
||||
|
||||
//---------------------完美分割线--------------------
|
||||
|
||||
//基础配置
|
||||
layim.config({
|
||||
|
||||
//初始化接口
|
||||
init: {
|
||||
url: '/imx/friends?token=#(token)'
|
||||
,data: {}
|
||||
}
|
||||
/*init: {
|
||||
url: '/tmp/json/getList.json'
|
||||
,data: {}
|
||||
}*/
|
||||
|
||||
//或采用以下方式初始化接口
|
||||
/*
|
||||
,init: {
|
||||
mine: {
|
||||
"username": "LayIM体验者" //我的昵称
|
||||
,"id": "100000123" //我的ID
|
||||
,"status": "online" //在线状态 online:在线、hide:隐身
|
||||
,"remark": "在深邃的编码世界,做一枚轻盈的纸飞机" //我的签名
|
||||
,"avatar": "a.jpg" //我的头像
|
||||
}
|
||||
,friend: []
|
||||
,group: []
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
//查看群员接口
|
||||
,members: {
|
||||
url: '/tmp/json/getMembers.json'
|
||||
,data: {}
|
||||
}
|
||||
|
||||
//上传图片接口
|
||||
/*,uploadImage: {
|
||||
url: 'http://localhost/os/chat/upload/'//'/upload/image' //(返回的数据格式见下文)
|
||||
,type: '' //默认post
|
||||
}*/
|
||||
|
||||
//上传文件接口
|
||||
/*,uploadFile: {
|
||||
url: '/os/chat/upload' //(返回的数据格式见下文)
|
||||
,type: '' //默认post
|
||||
}*/
|
||||
|
||||
,isAudio: true //开启聊天工具栏音频
|
||||
,isVideo: true //开启聊天工具栏视频
|
||||
|
||||
//扩展工具栏
|
||||
,tool: [{
|
||||
alias: 'code'
|
||||
,title: '代码'
|
||||
,icon: ''
|
||||
}]
|
||||
|
||||
//,brief: true //是否简约模式(若开启则不显示主面板)
|
||||
|
||||
//,title: 'WebIM' //自定义主面板最小化时的标题
|
||||
//,right: '100px' //主面板相对浏览器右侧距离
|
||||
//,minRight: '90px' //聊天面板最小化时相对浏览器右侧距离
|
||||
,initSkin: '5.jpg' //1-5 设置初始背景
|
||||
//,skin: ['aaa.jpg'] //新增皮肤
|
||||
//,isfriend: false //是否开启好友
|
||||
,isgroup: false //是否开启群组
|
||||
//,min: true //是否始终最小化主面板,默认false
|
||||
,notice: true //是否开启桌面消息提醒,默认false
|
||||
//,voice: false //声音提醒,默认开启,声音文件为:default.mp3
|
||||
|
||||
//,msgbox: layui.cache.dir + 'css/modules/layim/html/msgbox.html' //消息盒子页面地址,若不开启,剔除该项即可
|
||||
//,find: layui.cache.dir + 'css/modules/layim/html/find.html' //发现页面地址,若不开启,剔除该项即可
|
||||
//,chatLog: layui.cache.dir + 'css/modules/layim/html/chatlog.html' //聊天记录页面地址,若不开启,剔除该项即可
|
||||
,copyright:true
|
||||
});
|
||||
|
||||
/*
|
||||
layim.chat({
|
||||
name: '在线客服-小苍'
|
||||
,type: 'kefu'
|
||||
,avatar: 'http://tva3.sinaimg.cn/crop.0.0.180.180.180/7f5f6861jw1e8qgp5bmzyj2050050aa8.jpg'
|
||||
,id: -1
|
||||
});
|
||||
layim.chat({
|
||||
name: '在线客服-心心'
|
||||
,type: 'kefu'
|
||||
,avatar: 'http://tva1.sinaimg.cn/crop.219.144.555.555.180/0068iARejw8esk724mra6j30rs0rstap.jpg'
|
||||
,id: -2
|
||||
});
|
||||
layim.setChatMin();*/
|
||||
|
||||
//监听在线状态的切换事件
|
||||
layim.on('online', function(data){
|
||||
//console.log(data);
|
||||
});
|
||||
|
||||
//监听签名修改
|
||||
layim.on('sign', function(value){
|
||||
$.post("/os/user/update",{
|
||||
bean:JSON.stringify({sign:value})
|
||||
,columns:JSON.stringify(['sign'])
|
||||
},function (res) {
|
||||
if(res.retcode == 0){
|
||||
layer.msg("操作成功");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//监听自定义工具栏点击,以添加代码为例
|
||||
layim.on('tool(code)', function(insert){
|
||||
layer.prompt({
|
||||
title: '插入代码'
|
||||
,formType: 2
|
||||
,shade: 0
|
||||
}, function(text, index){
|
||||
layer.close(index);
|
||||
insert('[pre class=layui-code]' + text + '[/pre]'); //将内容插入到编辑器
|
||||
});
|
||||
});
|
||||
|
||||
//监听layim建立就绪
|
||||
layim.on('ready', function(res){
|
||||
|
||||
//console.log(res.mine);
|
||||
|
||||
//layim.msgbox(5); //模拟消息盒子有新消息,实际使用时,一般是动态获得
|
||||
|
||||
//添加好友(如果检测到该socket)
|
||||
layim.addList({
|
||||
type: 'group'
|
||||
,avatar: "http://tva3.sinaimg.cn/crop.64.106.361.361.50/7181dbb3jw8evfbtem8edj20ci0dpq3a.jpg"
|
||||
,groupname: 'Angular开发'
|
||||
,id: "12333333"
|
||||
,members: 0
|
||||
});
|
||||
/*layim.addList({
|
||||
type: 'friend'
|
||||
,avatar: "http://tp2.sinaimg.cn/2386568184/180/40050524279/0"
|
||||
,username: '冲田杏梨'
|
||||
,groupid: 2
|
||||
,id: "1233333312121212"
|
||||
,remark: "本人冲田杏梨将结束AV女优的工作"
|
||||
});*/
|
||||
|
||||
if (false)
|
||||
setTimeout(function(){
|
||||
//接受消息(如果检测到该socket)
|
||||
layim.getMessage({
|
||||
username: "Hi"
|
||||
,avatar: "http://qzapp.qlogo.cn/qzapp/100280987/56ADC83E78CEC046F8DF2C5D0DD63CDE/100"
|
||||
,id: "10000111"
|
||||
,type: "friend"
|
||||
,content: "临时:"+ new Date().getTime()
|
||||
});
|
||||
|
||||
/*layim.getMessage({
|
||||
username: "贤心"
|
||||
,avatar: "http://tp1.sinaimg.cn/1571889140/180/40030060651/1"
|
||||
,id: "100001"
|
||||
,type: "friend"
|
||||
,content: "嗨,你好!欢迎体验LayIM。演示标记:"+ new Date().getTime()
|
||||
});*/
|
||||
|
||||
}, 3000);
|
||||
});
|
||||
|
||||
//监听发送消息
|
||||
layim.on('sendMessage', function(data){
|
||||
//var To = data.to;
|
||||
|
||||
/*if(To.type === 'friend'){
|
||||
layim.setChatStatus('<span style="color:#FF5722;">对方正在输入。。。</span>');
|
||||
}*/
|
||||
|
||||
//演示自动回复
|
||||
if (false)
|
||||
setTimeout(function(){
|
||||
var obj = {};
|
||||
if(To.type === 'group'){
|
||||
obj = {
|
||||
username: '模拟群员'+(Math.random()*100|0)
|
||||
,avatar: layui.cache.dir + 'images/face/'+ (Math.random()*72|0) + '.gif'
|
||||
,id: To.id
|
||||
,type: To.type
|
||||
,content: autoReplay[Math.random()*9|0]
|
||||
}
|
||||
} else {
|
||||
obj = {
|
||||
username: To.name
|
||||
,avatar: To.avatar
|
||||
,id: To.id
|
||||
,type: To.type
|
||||
,content: autoReplay[Math.random()*9|0]
|
||||
}
|
||||
layim.setChatStatus('<span style="color:#FF5722;">在线</span>');
|
||||
}
|
||||
layim.getMessage(obj);
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
//监听查看群员
|
||||
layim.on('members', function(data){
|
||||
//console.log(data);
|
||||
});
|
||||
|
||||
//监听聊天窗口的切换
|
||||
layim.on('chatChange', function(res){
|
||||
var type = res.data.type;
|
||||
console.log(res.data.id)
|
||||
if(type === 'friend'){
|
||||
//模拟标注好友状态
|
||||
//layim.setChatStatus('<span style="color:#FF5722;">在线</span>');
|
||||
} else if(type === 'group'){
|
||||
//模拟系统消息
|
||||
layim.getMessage({
|
||||
system: true
|
||||
,id: res.data.id
|
||||
,type: "group"
|
||||
,content: '模拟群员'+(Math.random()*100|0) + '加入群聊'
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
#end
|
||||
|
11
root/admin/index.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!--- Created by JUECHENG at 2018/7/19 10:38. --->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -175,6 +175,13 @@
|
||||
</div>
|
||||
#end
|
||||
|
||||
<div class="fly-panel fly-signin">
|
||||
<div class="fly-panel-main fly-signin-main">
|
||||
<div>JAVA后端架构设计群:<cite>237626260</cite></div>
|
||||
<div>Redkale技术交流群:<cite>527523235</cite></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--最新加入-->
|
||||
<div class="fly-panel fly-rank fly-rank-reply" id="LAY_replyRank">
|
||||
<h3 class="fly-panel-title">
|
||||
|
@ -1,2 +1,2 @@
|
||||
/** layui-v2.2.3 MIT License By http://www.layui.com */
|
||||
/** layui-v2.3.0 MIT License By https://www.layui.com */
|
||||
html #layuicss-skincodecss{display:none;position:absolute;width:1989px}.layui-code-h3,.layui-code-view{position:relative;font-size:12px}.layui-code-view{display:block;margin:10px 0;padding:0;border:1px solid #e2e2e2;border-left-width:6px;background-color:#F2F2F2;color:#333;font-family:Courier New}.layui-code-h3{padding:0 10px;height:32px;line-height:32px;border-bottom:1px solid #e2e2e2}.layui-code-h3 a{position:absolute;right:10px;top:0;color:#999}.layui-code-view .layui-code-ol{position:relative;overflow:auto}.layui-code-view .layui-code-ol li{position:relative;margin-left:45px;line-height:20px;padding:0 5px;border-left:1px solid #e2e2e2;list-style-type:decimal-leading-zero;*list-style-type:decimal;background-color:#fff}.layui-code-view pre{margin:0}.layui-code-notepad{border:1px solid #0C0C0C;border-left-color:#3F3F3F;background-color:#0C0C0C;color:#C2BE9E}.layui-code-notepad .layui-code-h3{border-bottom:none}.layui-code-notepad .layui-code-ol li{background-color:#3F3F3F;border-left:none}
|
Before Width: | Height: | Size: 314 B |
96
root/res/layui/css/modules/layim/html/chatlog.html
Normal file
@ -0,0 +1,96 @@
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<title>聊天记录</title>
|
||||
|
||||
<link rel="stylesheet" href="http://local.res.layui.com/layui/src/css/layui.css">
|
||||
<style>
|
||||
body .layim-chat-main{height: auto;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="layim-chat-main">
|
||||
<ul id="LAY_view"></ul>
|
||||
</div>
|
||||
|
||||
<div id="LAY_page" style="margin: 0 10px;"></div>
|
||||
|
||||
|
||||
<textarea title="消息模版" id="LAY_tpl" style="display:none;">
|
||||
{{# layui.each(d.data, function(index, item){
|
||||
if(item.id == parent.layui.layim.cache().mine.id){ }}
|
||||
<li class="layim-chat-mine"><div class="layim-chat-user"><img src="{{ item.avatar }}"><cite><i>{{ layui.data.date(item.timestamp) }}</i>{{ item.username }}</cite></div><div class="layim-chat-text">{{ layui.layim.content(item.content) }}</div></li>
|
||||
{{# } else { }}
|
||||
<li><div class="layim-chat-user"><img src="{{ item.avatar }}"><cite>{{ item.username }}<i>{{ layui.data.date(item.timestamp) }}</i></cite></div><div class="layim-chat-text">{{ layui.layim.content(item.content) }}</div></li>
|
||||
{{# }
|
||||
}); }}
|
||||
</textarea>
|
||||
|
||||
<!--
|
||||
上述模版采用了 laytpl 语法,不了解的同学可以去看下文档:http://www.layui.com/doc/modules/laytpl.html
|
||||
|
||||
-->
|
||||
|
||||
|
||||
<script src="http://local.res.layui.com/layui/src/layui.js"></script>
|
||||
<script>
|
||||
layui.use(['layim', 'laypage'], function(){
|
||||
var layim = layui.layim
|
||||
,layer = layui.layer
|
||||
,laytpl = layui.laytpl
|
||||
,$ = layui.jquery
|
||||
,laypage = layui.laypage;
|
||||
|
||||
//聊天记录的分页此处不做演示,你可以采用laypage,不了解的同学见文档:http://www.layui.com/doc/modules/laypage.html
|
||||
|
||||
|
||||
//开始请求聊天记录
|
||||
var param = location.search //获得URL参数。该窗口url会携带会话id和type,他们是你请求聊天记录的重要凭据
|
||||
|
||||
//实际使用时,下述的res一般是通过Ajax获得,而此处仅仅只是演示数据格式
|
||||
,res = {
|
||||
code: 0
|
||||
,msg: ''
|
||||
,data: [{
|
||||
username: '纸飞机'
|
||||
,id: 100000
|
||||
,avatar: 'http://tva3.sinaimg.cn/crop.0.0.512.512.180/8693225ajw8f2rt20ptykj20e80e8weu.jpg'
|
||||
,timestamp: 1480897882000
|
||||
,content: 'face[抱抱] face[心] 你好啊小美女'
|
||||
}, {
|
||||
username: 'Z_子晴'
|
||||
,id: 108101
|
||||
,avatar: 'http://tva3.sinaimg.cn/crop.0.0.512.512.180/8693225ajw8f2rt20ptykj20e80e8weu.jpg'
|
||||
,timestamp: 1480897892000
|
||||
,content: '你没发错吧?face[微笑]'
|
||||
},{
|
||||
username: 'Z_子晴'
|
||||
,id: 108101
|
||||
,avatar: 'http://tva3.sinaimg.cn/crop.0.0.512.512.180/8693225ajw8f2rt20ptykj20e80e8weu.jpg'
|
||||
,timestamp: 1480897898000
|
||||
,content: '你是谁呀亲。。我爱的是贤心!我爱的是贤心!我爱的是贤心!重要的事情要说三遍~'
|
||||
},{
|
||||
username: 'Z_子晴'
|
||||
,id: 108101
|
||||
,avatar: 'http://tva3.sinaimg.cn/crop.0.0.512.512.180/8693225ajw8f2rt20ptykj20e80e8weu.jpg'
|
||||
,timestamp: 1480897908000
|
||||
,content: '注意:这些都是模拟数据,实际使用时,需将其中的模拟接口改为你的项目真实接口。\n该模版文件所在目录(相对于layui.js):\n/css/modules/layim/html/chatlog.html'
|
||||
}]
|
||||
}
|
||||
|
||||
//console.log(param)
|
||||
|
||||
var html = laytpl(LAY_tpl.value).render({
|
||||
data: res.data
|
||||
});
|
||||
$('#LAY_view').html(html);
|
||||
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
38
root/res/layui/css/modules/layim/html/find.html
Normal file
@ -0,0 +1,38 @@
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<title>发现</title>
|
||||
|
||||
<link rel="stylesheet" href="http://local.res.layui.com/layui/src/css/layui.css">
|
||||
<style>
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div style="margin: 15px;">
|
||||
<blockquote class="layui-elem-quote">此为自定义的【查找】页面,因需求不一,所以官方暂不提供该模版结构与样式,实际使用时,可移至该文件到你的项目中,对页面自行把控。
|
||||
<br>文件所在目录(相对于layui.js):/css/modules/layim/html/find.html</blockquote>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<script src="http://local.res.layui.com/layui/src/layui.js"></script>
|
||||
<script>
|
||||
layui.use(['layim', 'laypage'], function(){
|
||||
var layim = layui.layim
|
||||
,layer = layui.layer
|
||||
,laytpl = layui.laytpl
|
||||
,$ = layui.jquery
|
||||
,laypage = layui.laypage;
|
||||
|
||||
//一些添加好友请求之类的交互参见文档
|
||||
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
87
root/res/layui/css/modules/layim/html/getmsg.json
Normal file
@ -0,0 +1,87 @@
|
||||
{
|
||||
"code": 0,
|
||||
"pages": 1,
|
||||
"data": [
|
||||
{
|
||||
"id": 76,
|
||||
"content": "申请添加你为好友",
|
||||
"uid": 168,
|
||||
"from": 166488,
|
||||
"from_group": 0,
|
||||
"type": 1,
|
||||
"remark": "有问题要问",
|
||||
"href": null,
|
||||
"read": 1,
|
||||
"time": "刚刚",
|
||||
"user": {
|
||||
"id": 166488,
|
||||
"avatar": "http://q.qlogo.cn/qqapp/101235792/B704597964F9BD0DB648292D1B09F7E8/100",
|
||||
"username": "李彦宏",
|
||||
"sign": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 75,
|
||||
"content": "申请添加你为好友",
|
||||
"uid": 168,
|
||||
"from": 347592,
|
||||
"from_group": 0,
|
||||
"type": 1,
|
||||
"remark": "你好啊!",
|
||||
"href": null,
|
||||
"read": 1,
|
||||
"time": "刚刚",
|
||||
"user": {
|
||||
"id": 347592,
|
||||
"avatar": "http://q.qlogo.cn/qqapp/101235792/B78751375E0531675B1272AD994BA875/100",
|
||||
"username": "麻花疼",
|
||||
"sign": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 62,
|
||||
"content": "雷军 拒绝了你的好友申请",
|
||||
"uid": 168,
|
||||
"from": null,
|
||||
"from_group": null,
|
||||
"type": 1,
|
||||
"remark": null,
|
||||
"href": null,
|
||||
"read": 1,
|
||||
"time": "10天前",
|
||||
"user": {
|
||||
"id": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 60,
|
||||
"content": "马小云 已经同意你的好友申请",
|
||||
"uid": 168,
|
||||
"from": null,
|
||||
"from_group": null,
|
||||
"type": 1,
|
||||
"remark": null,
|
||||
"href": null,
|
||||
"read": 1,
|
||||
"time": "10天前",
|
||||
"user": {
|
||||
"id": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 61,
|
||||
"content": "贤心 已经同意你的好友申请",
|
||||
"uid": 168,
|
||||
"from": null,
|
||||
"from_group": null,
|
||||
"type": 1,
|
||||
"remark": null,
|
||||
"href": null,
|
||||
"read": 1,
|
||||
"time": "10天前",
|
||||
"user": {
|
||||
"id": null
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
208
root/res/layui/css/modules/layim/html/msgbox.html
Normal file
@ -0,0 +1,208 @@
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<title>消息盒子</title>
|
||||
|
||||
<link rel="stylesheet" href="../../../layui.css?v=1">
|
||||
<style>
|
||||
.layim-msgbox{margin: 15px;}
|
||||
.layim-msgbox li{position: relative; margin-bottom: 10px; padding: 0 130px 10px 60px; padding-bottom: 10px; line-height: 22px; border-bottom: 1px dotted #e2e2e2;}
|
||||
.layim-msgbox .layim-msgbox-tips{margin: 0; padding: 10px 0; border: none; text-align: center; color: #999;}
|
||||
.layim-msgbox .layim-msgbox-system{padding: 0 10px 10px 10px;}
|
||||
.layim-msgbox li p span{padding-left: 5px; color: #999;}
|
||||
.layim-msgbox li p em{font-style: normal; color: #FF5722;}
|
||||
|
||||
.layim-msgbox-avatar{position: absolute; left: 0; top: 0; width: 50px; height: 50px;}
|
||||
.layim-msgbox-user{padding-top: 5px;}
|
||||
.layim-msgbox-content{margin-top: 3px;}
|
||||
.layim-msgbox .layui-btn-small{padding: 0 15px; margin-left: 5px;}
|
||||
.layim-msgbox-btn{position: absolute; right: 0; top: 12px; color: #999;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<ul class="layim-msgbox" id="LAY_view"></ul>
|
||||
|
||||
<div style="margin: 0 15px;">
|
||||
<blockquote class="layui-elem-quote">注意:这些都是模拟数据,实际使用时,需将其中的模拟接口改为你的项目真实接口。
|
||||
<br>该模版文件所在目录(相对于layui.js):/css/modules/layim/html/msgbox.html</blockquote>
|
||||
</div>
|
||||
|
||||
<textarea title="消息模版" id="LAY_tpl" style="display:none;">
|
||||
{{# layui.each(d.data, function(index, item){
|
||||
if(item.from){ }}
|
||||
<li data-uid="{{ item.from }}" data-fromGroup="{{ item.from_group }}">
|
||||
<a href="/u/{{ item.from }}/" target="_blank">
|
||||
<img src="{{ item.user.avatar }}" class="layui-circle layim-msgbox-avatar">
|
||||
</a>
|
||||
<p class="layim-msgbox-user">
|
||||
<a href="/u/{{ item.from }}/" target="_blank">{{ item.user.username||'' }}</a>
|
||||
<span>{{ item.time }}</span>
|
||||
</p>
|
||||
<p class="layim-msgbox-content">
|
||||
{{ item.content }}
|
||||
<span>{{ item.remark ? '附言: '+item.remark : '' }}</span>
|
||||
</p>
|
||||
<p class="layim-msgbox-btn">
|
||||
<button class="layui-btn layui-btn-small" data-type="agree">同意</button>
|
||||
<button class="layui-btn layui-btn-small layui-btn-primary" data-type="refuse">拒绝</button>
|
||||
</p>
|
||||
</li>
|
||||
{{# } else { }}
|
||||
<li class="layim-msgbox-system">
|
||||
<p><em>系统:</em>{{ item.content }}<span>{{ item.time }}</span></p>
|
||||
</li>
|
||||
{{# }
|
||||
}); }}
|
||||
</textarea>
|
||||
|
||||
<!--
|
||||
上述模版采用了 laytpl 语法,不了解的同学可以去看下文档:http://www.layui.com/doc/modules/laytpl.html
|
||||
-->
|
||||
|
||||
|
||||
<script src="../../../../layui.js?v=1"></script>
|
||||
<script>
|
||||
layui.use(['layim', 'flow'], function(){
|
||||
var layim = layui.layim
|
||||
,layer = layui.layer
|
||||
,laytpl = layui.laytpl
|
||||
,$ = layui.jquery
|
||||
,flow = layui.flow;
|
||||
|
||||
var cache = {}; //用于临时记录请求到的数据
|
||||
|
||||
//请求消息
|
||||
var renderMsg = function(page, callback){
|
||||
|
||||
//实际部署时,请将下述 getmsg.json 改为你的接口地址
|
||||
|
||||
$.get('getmsg.json', {
|
||||
page: page || 1
|
||||
}, function(res){
|
||||
if(res.code != 0){
|
||||
return layer.msg(res.msg);
|
||||
}
|
||||
|
||||
//记录来源用户信息
|
||||
layui.each(res.data, function(index, item){
|
||||
cache[item.from] = item.user;
|
||||
});
|
||||
|
||||
callback && callback(res.data, res.pages);
|
||||
});
|
||||
};
|
||||
|
||||
//消息信息流
|
||||
flow.load({
|
||||
elem: '#LAY_view' //流加载容器
|
||||
,isAuto: false
|
||||
,end: '<li class="layim-msgbox-tips">暂无更多新消息</li>'
|
||||
,done: function(page, next){ //加载下一页
|
||||
renderMsg(page, function(data, pages){
|
||||
var html = laytpl(LAY_tpl.value).render({
|
||||
data: data
|
||||
,page: page
|
||||
});
|
||||
next(html, page < pages);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
//打开页面即把消息标记为已读
|
||||
/*
|
||||
$.post('/message/read', {
|
||||
type: 1
|
||||
});
|
||||
*/
|
||||
|
||||
//操作
|
||||
var active = {
|
||||
//同意
|
||||
agree: function(othis){
|
||||
var li = othis.parents('li')
|
||||
,uid = li.data('uid')
|
||||
,from_group = li.data('fromGroup')
|
||||
,user = cache[uid];
|
||||
|
||||
//选择分组
|
||||
parent.layui.layim.setFriendGroup({
|
||||
type: 'friend'
|
||||
,username: user.username
|
||||
,avatar: user.avatar
|
||||
,group: parent.layui.layim.cache().friend //获取好友分组数据
|
||||
,submit: function(group, index){
|
||||
|
||||
//将好友追加到主面板
|
||||
parent.layui.layim.addList({
|
||||
type: 'friend'
|
||||
,avatar: user.avatar //好友头像
|
||||
,username: user.username //好友昵称
|
||||
,groupid: group //所在的分组id
|
||||
,id: uid //好友ID
|
||||
,sign: user.sign //好友签名
|
||||
});
|
||||
parent.layer.close(index);
|
||||
othis.parent().html('已同意');
|
||||
|
||||
|
||||
//实际部署时,请开启下述注释,并改成你的接口地址
|
||||
/*
|
||||
$.post('/im/agreeFriend', {
|
||||
uid: uid //对方用户ID
|
||||
,from_group: from_group //对方设定的好友分组
|
||||
,group: group //我设定的好友分组
|
||||
}, function(res){
|
||||
if(res.code != 0){
|
||||
return layer.msg(res.msg);
|
||||
}
|
||||
|
||||
//将好友追加到主面板
|
||||
parent.layui.layim.addList({
|
||||
type: 'friend'
|
||||
,avatar: user.avatar //好友头像
|
||||
,username: user.username //好友昵称
|
||||
,groupid: group //所在的分组id
|
||||
,id: uid //好友ID
|
||||
,sign: user.sign //好友签名
|
||||
});
|
||||
parent.layer.close(index);
|
||||
othis.parent().html('已同意');
|
||||
});
|
||||
*/
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//拒绝
|
||||
,refuse: function(othis){
|
||||
var li = othis.parents('li')
|
||||
,uid = li.data('uid');
|
||||
|
||||
layer.confirm('确定拒绝吗?', function(index){
|
||||
$.post('/im/refuseFriend', {
|
||||
uid: uid //对方用户ID
|
||||
}, function(res){
|
||||
if(res.code != 0){
|
||||
return layer.msg(res.msg);
|
||||
}
|
||||
layer.close(index);
|
||||
othis.parent().html('<em>已拒绝</em>');
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$('body').on('click', '.layui-btn', function(){
|
||||
var othis = $(this), type = othis.data('type');
|
||||
active[type] ? active[type].call(this, othis) : '';
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
2
root/res/layui/css/modules/layim/layim.css
Normal file
2
root/res/layui/css/modules/layim/mobile/layim.css
Normal file
BIN
root/res/layui/css/modules/layim/skin/1.jpg
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
root/res/layui/css/modules/layim/skin/2.jpg
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
root/res/layui/css/modules/layim/skin/3.jpg
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
root/res/layui/css/modules/layim/skin/4.jpg
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
root/res/layui/css/modules/layim/skin/5.jpg
Normal file
After Width: | Height: | Size: 33 KiB |
BIN
root/res/layui/css/modules/layim/skin/logo.jpg
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
root/res/layui/css/modules/layim/voice/default.mp3
Normal file
BIN
root/res/layui/css/modules/layim/voice/default_1.mp3
Normal file
Before Width: | Height: | Size: 222 KiB After Width: | Height: | Size: 271 KiB |
@ -1,2 +1,2 @@
|
||||
/** layui-v2.2.3 MIT License By http://www.layui.com */
|
||||
/** layui-v2.3.0 MIT License By https://www.layui.com */
|
||||
;layui.define("jquery",function(e){"use strict";var i=layui.$,n=(layui.hint(),layui.device(),{config:{},set:function(e){var n=this;return n.config=i.extend({},n.config,e),n},on:function(e,i){return layui.onevent.call(this,t,e,i)}}),t="carousel",a="layui-this",l=">*[carousel-item]>*",o="layui-carousel-left",r="layui-carousel-right",d="layui-carousel-prev",s="layui-carousel-next",u="layui-carousel-arrow",c="layui-carousel-ind",m=function(e){var t=this;t.config=i.extend({},t.config,n.config,e),t.render()};m.prototype.config={width:"600px",height:"280px",full:!1,arrow:"hover",indicator:"inside",autoplay:!0,interval:3e3,anim:"",trigger:"click",index:0},m.prototype.render=function(){var e=this,n=e.config;n.elem=i(n.elem),n.elem[0]&&(e.elemItem=n.elem.find(l),n.index<0&&(n.index=0),n.index>=e.elemItem.length&&(n.index=e.elemItem.length-1),n.interval<800&&(n.interval=800),n.full?n.elem.css({position:"fixed",width:"100%",height:"100%",zIndex:9999}):n.elem.css({width:n.width,height:n.height}),n.elem.attr("lay-anim",n.anim),e.elemItem.eq(n.index).addClass(a),e.elemItem.length<=1||(e.indicator(),e.arrow(),e.autoplay(),e.events()))},m.prototype.reload=function(e){var n=this;clearInterval(n.timer),n.config=i.extend({},n.config,e),n.render()},m.prototype.prevIndex=function(){var e=this,i=e.config,n=i.index-1;return n<0&&(n=e.elemItem.length-1),n},m.prototype.nextIndex=function(){var e=this,i=e.config,n=i.index+1;return n>=e.elemItem.length&&(n=0),n},m.prototype.addIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index+e,n.index>=i.elemItem.length&&(n.index=0)},m.prototype.subIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index-e,n.index<0&&(n.index=i.elemItem.length-1)},m.prototype.autoplay=function(){var e=this,i=e.config;i.autoplay&&(e.timer=setInterval(function(){e.slide()},i.interval))},m.prototype.arrow=function(){var e=this,n=e.config,t=i(['<button class="layui-icon '+u+'" lay-type="sub">'+("updown"===n.anim?"":"")+"</button>",'<button class="layui-icon '+u+'" lay-type="add">'+("updown"===n.anim?"":"")+"</button>"].join(""));n.elem.attr("lay-arrow",n.arrow),n.elem.find("."+u)[0]&&n.elem.find("."+u).remove(),n.elem.append(t),t.on("click",function(){var n=i(this),t=n.attr("lay-type");e.slide(t)})},m.prototype.indicator=function(){var e=this,n=e.config,t=e.elemInd=i(['<div class="'+c+'"><ul>',function(){var i=[];return layui.each(e.elemItem,function(e){i.push("<li"+(n.index===e?' class="layui-this"':"")+"></li>")}),i.join("")}(),"</ul></div>"].join(""));n.elem.attr("lay-indicator",n.indicator),n.elem.find("."+c)[0]&&n.elem.find("."+c).remove(),n.elem.append(t),"updown"===n.anim&&t.css("margin-top",-(t.height()/2)),t.find("li").on("hover"===n.trigger?"mouseover":n.trigger,function(){var t=i(this),a=t.index();a>n.index?e.slide("add",a-n.index):a<n.index&&e.slide("sub",n.index-a)})},m.prototype.slide=function(e,i){var n=this,l=n.elemItem,u=n.config,c=u.index,m=u.elem.attr("lay-filter");n.haveSlide||("sub"===e?(n.subIndex(i),l.eq(u.index).addClass(d),setTimeout(function(){l.eq(c).addClass(r),l.eq(u.index).addClass(r)},50)):(n.addIndex(i),l.eq(u.index).addClass(s),setTimeout(function(){l.eq(c).addClass(o),l.eq(u.index).addClass(o)},50)),setTimeout(function(){l.removeClass(a+" "+d+" "+s+" "+o+" "+r),l.eq(u.index).addClass(a),n.haveSlide=!1},300),n.elemInd.find("li").eq(u.index).addClass(a).siblings().removeClass(a),n.haveSlide=!0,layui.event.call(this,t,"change("+m+")",{index:u.index,prevIndex:c,item:l.eq(u.index)}))},m.prototype.events=function(){var e=this,i=e.config;i.elem.data("haveEvents")||(i.elem.on("mouseenter",function(){clearInterval(e.timer)}).on("mouseleave",function(){e.autoplay()}),i.elem.data("haveEvents",!0))},n.render=function(e){var i=new m(e);return i},e(t,n)});
|
@ -1,2 +1,2 @@
|
||||
/** layui-v2.2.3 MIT License By http://www.layui.com */
|
||||
/** layui-v2.3.0 MIT License By https://www.layui.com */
|
||||
;layui.define("jquery",function(e){"use strict";var a=layui.$,l="http://www.layui.com/doc/modules/code.html";e("code",function(e){var t=[];e=e||{},e.elem=a(e.elem||".layui-code"),e.about=!("about"in e)||e.about,e.elem.each(function(){t.push(this)}),layui.each(t.reverse(),function(t,i){var c=a(i),o=c.html();(c.attr("lay-encode")||e.encode)&&(o=o.replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""")),c.html('<ol class="layui-code-ol"><li>'+o.replace(/[\r\t\n]+/g,"</li><li>")+"</li></ol>"),c.find(">.layui-code-h3")[0]||c.prepend('<h3 class="layui-code-h3">'+(c.attr("lay-title")||e.title||"code")+(e.about?'<a href="'+l+'" target="_blank">layui.code</a>':"")+"</h3>");var d=c.find(">.layui-code-ol");c.addClass("layui-box layui-code-view"),(c.attr("lay-skin")||e.skin)&&c.addClass("layui-code-"+(c.attr("lay-skin")||e.skin)),(d.find("li").length/100|0)>0&&d.css("margin-left",(d.find("li").length/100|0)+"px"),(c.attr("lay-height")||e.height)&&d.css("max-height",c.attr("lay-height")||e.height)})})}).addcss("modules/code.css","skincodecss");
|
@ -1,2 +1,2 @@
|
||||
/** layui-v2.2.3 MIT License By http://www.layui.com */
|
||||
/** layui-v2.3.0 MIT License By https://www.layui.com */
|
||||
;layui.define("jquery",function(e){"use strict";var l=layui.$,o=function(e){},t='<i class="layui-anim layui-anim-rotate layui-anim-loop layui-icon "></i>';o.prototype.load=function(e){var o,i,n,r,a=this,c=0;e=e||{};var f=l(e.elem);if(f[0]){var m=l(e.scrollElem||document),u=e.mb||50,s=!("isAuto"in e)||e.isAuto,v=e.end||"没有更多了",y=e.scrollElem&&e.scrollElem!==document,d="<cite>加载更多</cite>",h=l('<div class="layui-flow-more"><a href="javascript:;">'+d+"</a></div>");f.find(".layui-flow-more")[0]||f.append(h);var p=function(e,t){e=l(e),h.before(e),t=0==t||null,t?h.html(v):h.find("a").html(d),i=t,o=null,n&&n()},g=function(){o=!0,h.find("a").html(t),"function"==typeof e.done&&e.done(++c,p)};if(g(),h.find("a").on("click",function(){l(this);i||o||g()}),e.isLazyimg)var n=a.lazyimg({elem:e.elem+" img",scrollElem:e.scrollElem});return s?(m.on("scroll",function(){var e=l(this),t=e.scrollTop();r&&clearTimeout(r),i||(r=setTimeout(function(){var i=y?e.height():l(window).height(),n=y?e.prop("scrollHeight"):document.documentElement.scrollHeight;n-t-i<=u&&(o||g())},100))}),a):a}},o.prototype.lazyimg=function(e){var o,t=this,i=0;e=e||{};var n=l(e.scrollElem||document),r=e.elem||"img",a=e.scrollElem&&e.scrollElem!==document,c=function(e,l){var o=n.scrollTop(),r=o+l,c=a?function(){return e.offset().top-n.offset().top+o}():e.offset().top;if(c>=o&&c<=r&&!e.attr("src")){var m=e.attr("lay-src");layui.img(m,function(){var l=t.lazyimg.elem.eq(i);e.attr("src",m).removeAttr("lay-src"),l[0]&&f(l),i++})}},f=function(e,o){var f=a?(o||n).height():l(window).height(),m=n.scrollTop(),u=m+f;if(t.lazyimg.elem=l(r),e)c(e,f);else for(var s=0;s<t.lazyimg.elem.length;s++){var v=t.lazyimg.elem.eq(s),y=a?function(){return v.offset().top-n.offset().top+m}():v.offset().top;if(c(v,f),i=s,y>u)break}};if(f(),!o){var m;n.on("scroll",function(){var e=l(this);m&&clearTimeout(m),m=setTimeout(function(){f(null,e)},50)}),o=!0}return f},e("flow",new o)});
|
2
root/res/layui/lay/modules/jquery.js
vendored
3
root/res/layui/lay/modules/layim.js
Normal file
@ -1,2 +1,2 @@
|
||||
/** layui-v2.2.3 MIT License By http://www.layui.com */
|
||||
;layui.define(function(e){"use strict";var a=document,t="getElementById",n="getElementsByTagName",i="laypage",r="layui-disabled",u=function(e){var a=this;a.config=e||{},a.config.index=++s.index,a.render(!0)};u.prototype.type=function(){var e=this.config;if("object"==typeof e.elem)return void 0===e.elem.length?2:3},u.prototype.view=function(){var e=this,a=e.config,t=a.groups="groups"in a?0|a.groups:5;a.layout="object"==typeof a.layout?a.layout:["prev","page","next"],a.count=0|a.count,a.curr=0|a.curr||1,a.limits="object"==typeof a.limits?a.limits:[10,20,30,40,50],a.limit=0|a.limit||10,a.pages=Math.ceil(a.count/a.limit)||1,a.curr>a.pages&&(a.curr=a.pages),t<0?t=1:t>a.pages&&(t=a.pages),a.prev="prev"in a?a.prev:"上一页",a.next="next"in a?a.next:"下一页";var n=a.pages>t?Math.ceil((a.curr+(t>1?1:0))/(t>0?t:1)):1,i={prev:function(){return a.prev?'<a href="javascript:;" class="layui-laypage-prev'+(1==a.curr?" "+r:"")+'" data-page="'+(a.curr-1)+'">'+a.prev+"</a>":""}(),page:function(){var e=[];if(a.count<1)return"";n>1&&a.first!==!1&&0!==t&&e.push('<a href="javascript:;" class="layui-laypage-first" data-page="1" title="首页">'+(a.first||1)+"</a>");var i=Math.floor((t-1)/2),r=n>1?a.curr-i:1,u=n>1?function(){var e=a.curr+(t-i-1);return e>a.pages?a.pages:e}():t;for(u-r<t-1&&(r=u-t+1),a.first!==!1&&r>2&&e.push('<span class="layui-laypage-spr">…</span>');r<=u;r++)r===a.curr?e.push('<span class="layui-laypage-curr"><em class="layui-laypage-em" '+(/^#/.test(a.theme)?'style="background-color:'+a.theme+';"':"")+"></em><em>"+r+"</em></span>"):e.push('<a href="javascript:;" data-page="'+r+'">'+r+"</a>");return a.pages>t&&a.pages>u&&a.last!==!1&&(u+1<a.pages&&e.push('<span class="layui-laypage-spr">…</span>'),0!==t&&e.push('<a href="javascript:;" class="layui-laypage-last" title="尾页" data-page="'+a.pages+'">'+(a.last||a.pages)+"</a>")),e.join("")}(),next:function(){return a.next?'<a href="javascript:;" class="layui-laypage-next'+(a.curr==a.pages?" "+r:"")+'" data-page="'+(a.curr+1)+'">'+a.next+"</a>":""}(),count:'<span class="layui-laypage-count">共 '+a.count+" 条</span>",limit:function(){var e=['<span class="layui-laypage-limits"><select lay-ignore>'];return layui.each(a.limits,function(t,n){e.push('<option value="'+n+'"'+(n===a.limit?"selected":"")+">"+n+" 条/页</option>")}),e.join("")+"</select></span>"}(),skip:function(){return['<span class="layui-laypage-skip">到第','<input type="text" min="1" value="'+a.curr+'" class="layui-input">','页<button type="button" class="layui-laypage-btn">确定</button>',"</span>"].join("")}()};return['<div class="layui-box layui-laypage layui-laypage-'+(a.theme?/^#/.test(a.theme)?"molv":a.theme:"default")+'" id="layui-laypage-'+a.index+'">',function(){var e=[];return layui.each(a.layout,function(a,t){i[t]&&e.push(i[t])}),e.join("")}(),"</div>"].join("")},u.prototype.jump=function(e,a){if(e){var t=this,i=t.config,r=e.children,u=e[n]("button")[0],l=e[n]("input")[0],p=e[n]("select")[0],c=function(){var e=0|l.value.replace(/\s|\D/g,"");e&&(i.curr=e,t.render())};if(a)return c();for(var o=0,y=r.length;o<y;o++)"a"===r[o].nodeName.toLowerCase()&&s.on(r[o],"click",function(){var e=0|this.getAttribute("data-page");e<1||e>i.pages||(i.curr=e,t.render())});p&&s.on(p,"change",function(){var e=this.value;i.curr*e>i.count&&(i.curr=Math.ceil(i.count/e)),i.limit=e,t.render()}),u&&s.on(u,"click",function(){c()})}},u.prototype.skip=function(e){if(e){var a=this,t=e[n]("input")[0];t&&s.on(t,"keyup",function(t){var n=this.value,i=t.keyCode;/^(37|38|39|40)$/.test(i)||(/\D/.test(n)&&(this.value=n.replace(/\D/,"")),13===i&&a.jump(e,!0))})}},u.prototype.render=function(e){var n=this,i=n.config,r=n.type(),u=n.view();2===r?i.elem&&(i.elem.innerHTML=u):3===r?i.elem.html(u):a[t](i.elem)&&(a[t](i.elem).innerHTML=u),i.jump&&i.jump(i,e);var s=a[t]("layui-laypage-"+i.index);n.jump(s),i.hash&&!e&&(location.hash="!"+i.hash+"="+i.curr),n.skip(s)};var s={render:function(e){var a=new u(e);return a.index},index:layui.laypage?layui.laypage.index+1e4:0,on:function(e,a,t){return e.attachEvent?e.attachEvent("on"+a,function(a){a.target=a.srcElement,t.call(e,a)}):e.addEventListener(a,t,!1),this}};e(i,s)});
|
||||
/** layui-v2.3.0 MIT License By https://www.layui.com */
|
||||
;layui.define(function(e){"use strict";var a=document,t="getElementById",n="getElementsByTagName",i="laypage",r="layui-disabled",u=function(e){var a=this;a.config=e||{},a.config.index=++s.index,a.render(!0)};u.prototype.type=function(){var e=this.config;if("object"==typeof e.elem)return void 0===e.elem.length?2:3},u.prototype.view=function(){var e=this,a=e.config,t=a.groups="groups"in a?0|a.groups:5;a.layout="object"==typeof a.layout?a.layout:["prev","page","next"],a.count=0|a.count,a.curr=0|a.curr||1,a.limits="object"==typeof a.limits?a.limits:[10,20,30,40,50],a.limit=0|a.limit||10,a.pages=Math.ceil(a.count/a.limit)||1,a.curr>a.pages&&(a.curr=a.pages),t<0?t=1:t>a.pages&&(t=a.pages),a.prev="prev"in a?a.prev:"上一页",a.next="next"in a?a.next:"下一页";var n=a.pages>t?Math.ceil((a.curr+(t>1?1:0))/(t>0?t:1)):1,i={prev:function(){return a.prev?'<a href="javascript:;" class="layui-laypage-prev'+(1==a.curr?" "+r:"")+'" data-page="'+(a.curr-1)+'">'+a.prev+"</a>":""}(),page:function(){var e=[];if(a.count<1)return"";n>1&&a.first!==!1&&0!==t&&e.push('<a href="javascript:;" class="layui-laypage-first" data-page="1" title="首页">'+(a.first||1)+"</a>");var i=Math.floor((t-1)/2),r=n>1?a.curr-i:1,u=n>1?function(){var e=a.curr+(t-i-1);return e>a.pages?a.pages:e}():t;for(u-r<t-1&&(r=u-t+1),a.first!==!1&&r>2&&e.push('<span class="layui-laypage-spr">…</span>');r<=u;r++)r===a.curr?e.push('<span class="layui-laypage-curr"><em class="layui-laypage-em" '+(/^#/.test(a.theme)?'style="background-color:'+a.theme+';"':"")+"></em><em>"+r+"</em></span>"):e.push('<a href="javascript:;" data-page="'+r+'">'+r+"</a>");return a.pages>t&&a.pages>u&&a.last!==!1&&(u+1<a.pages&&e.push('<span class="layui-laypage-spr">…</span>'),0!==t&&e.push('<a href="javascript:;" class="layui-laypage-last" title="尾页" data-page="'+a.pages+'">'+(a.last||a.pages)+"</a>")),e.join("")}(),next:function(){return a.next?'<a href="javascript:;" class="layui-laypage-next'+(a.curr==a.pages?" "+r:"")+'" data-page="'+(a.curr+1)+'">'+a.next+"</a>":""}(),count:'<span class="layui-laypage-count">共 '+a.count+" 条</span>",limit:function(){var e=['<span class="layui-laypage-limits"><select lay-ignore>'];return layui.each(a.limits,function(t,n){e.push('<option value="'+n+'"'+(n===a.limit?"selected":"")+">"+n+" 条/页</option>")}),e.join("")+"</select></span>"}(),refresh:['<a href="javascript:;" data-page="'+a.curr+'" class="layui-laypage-refresh">','<i class="layui-icon layui-icon-refresh"></i>',"</a>"].join(""),skip:function(){return['<span class="layui-laypage-skip">到第','<input type="text" min="1" value="'+a.curr+'" class="layui-input">','页<button type="button" class="layui-laypage-btn">确定</button>',"</span>"].join("")}()};return['<div class="layui-box layui-laypage layui-laypage-'+(a.theme?/^#/.test(a.theme)?"molv":a.theme:"default")+'" id="layui-laypage-'+a.index+'">',function(){var e=[];return layui.each(a.layout,function(a,t){i[t]&&e.push(i[t])}),e.join("")}(),"</div>"].join("")},u.prototype.jump=function(e,a){if(e){var t=this,i=t.config,r=e.children,u=e[n]("button")[0],l=e[n]("input")[0],p=e[n]("select")[0],c=function(){var e=0|l.value.replace(/\s|\D/g,"");e&&(i.curr=e,t.render())};if(a)return c();for(var o=0,y=r.length;o<y;o++)"a"===r[o].nodeName.toLowerCase()&&s.on(r[o],"click",function(){var e=0|this.getAttribute("data-page");e<1||e>i.pages||(i.curr=e,t.render())});p&&s.on(p,"change",function(){var e=this.value;i.curr*e>i.count&&(i.curr=Math.ceil(i.count/e)),i.limit=e,t.render()}),u&&s.on(u,"click",function(){c()})}},u.prototype.skip=function(e){if(e){var a=this,t=e[n]("input")[0];t&&s.on(t,"keyup",function(t){var n=this.value,i=t.keyCode;/^(37|38|39|40)$/.test(i)||(/\D/.test(n)&&(this.value=n.replace(/\D/,"")),13===i&&a.jump(e,!0))})}},u.prototype.render=function(e){var n=this,i=n.config,r=n.type(),u=n.view();2===r?i.elem&&(i.elem.innerHTML=u):3===r?i.elem.html(u):a[t](i.elem)&&(a[t](i.elem).innerHTML=u),i.jump&&i.jump(i,e);var s=a[t]("layui-laypage-"+i.index);n.jump(s),i.hash&&!e&&(location.hash="!"+i.hash+"="+i.curr),n.skip(s)};var s={render:function(e){var a=new u(e);return a.index},index:layui.laypage?layui.laypage.index+1e4:0,on:function(e,a,t){return e.attachEvent?e.attachEvent("on"+a,function(a){a.target=a.srcElement,t.call(e,a)}):e.addEventListener(a,t,!1),this}};e(i,s)});
|
@ -1,2 +1,2 @@
|
||||
/** layui-v2.2.3 MIT License By http://www.layui.com */
|
||||
/** layui-v2.3.0 MIT License By https://www.layui.com */
|
||||
;layui.define(function(e){"use strict";var r={open:"{{",close:"}}"},c={exp:function(e){return new RegExp(e,"g")},query:function(e,c,t){var o=["#([\\s\\S])+?","([^{#}])*?"][e||0];return n((c||"")+r.open+o+r.close+(t||""))},escape:function(e){return String(e||"").replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""")},error:function(e,r){var c="Laytpl Error:";return"object"==typeof console&&console.error(c+e+"\n"+(r||"")),c+e}},n=c.exp,t=function(e){this.tpl=e};t.pt=t.prototype,window.errors=0,t.pt.parse=function(e,t){var o=this,p=e,a=n("^"+r.open+"#",""),l=n(r.close+"$","");e=e.replace(/\s+|\r|\t|\n/g," ").replace(n(r.open+"#"),r.open+"# ").replace(n(r.close+"}"),"} "+r.close).replace(/\\/g,"\\\\").replace(n(r.open+"!(.+?)!"+r.close),function(e){return e=e.replace(n("^"+r.open+"!"),"").replace(n("!"+r.close),"").replace(n(r.open+"|"+r.close),function(e){return e.replace(/(.)/g,"\\$1")})}).replace(/(?="|')/g,"\\").replace(c.query(),function(e){return e=e.replace(a,"").replace(l,""),'";'+e.replace(/\\/g,"")+';view+="'}).replace(c.query(1),function(e){var c='"+(';return e.replace(/\s/g,"")===r.open+r.close?"":(e=e.replace(n(r.open+"|"+r.close),""),/^=/.test(e)&&(e=e.replace(/^=/,""),c='"+_escape_('),c+e.replace(/\\/g,"")+')+"')}),e='"use strict";var view = "'+e+'";return view;';try{return o.cache=e=new Function("d, _escape_",e),e(t,c.escape)}catch(u){return delete o.cache,c.error(u,p)}},t.pt.render=function(e,r){var n,t=this;return e?(n=t.cache?t.cache(e,c.escape):t.parse(t.tpl,e),r?void r(n):n):c.error("no data")};var o=function(e){return"string"!=typeof e?c.error("Template not found"):new t(e)};o.config=function(e){e=e||{};for(var c in e)r[c]=e[c]},o.v="1.2.0",e("laytpl",o)});
|
2
root/res/layui/lay/modules/rate.js
Normal file
@ -0,0 +1,2 @@
|
||||
/** layui-v2.3.0 MIT License By https://www.layui.com */
|
||||
;layui.define("jquery",function(e){"use strict";var a=layui.jquery,i={config:{},index:layui.rate?layui.rate.index+1e4:0,set:function(e){var i=this;return i.config=a.extend({},i.config,e),i},on:function(e,a){return layui.onevent.call(this,n,e,a)}},l=function(){var e=this,a=e.config;return{setvalue:function(a){e.setvalue.call(e,a)},config:a}},n="rate",t="layui-rate",o="layui-icon-rate",s="layui-icon-rate-solid",u="layui-icon-rate-half",r="layui-icon-rate-solid layui-icon-rate-half",c="layui-icon-rate-solid layui-icon-rate",f="layui-icon-rate layui-icon-rate-half",v=function(e){var l=this;l.index=++i.index,l.config=a.extend({},l.config,i.config,e),l.render()};v.prototype.config={length:5,text:!1,readonly:!1,half:!1,value:0,theme:""},v.prototype.render=function(){var e=this,i=e.config,l=i.theme?'style="color: '+i.theme+';"':"";i.elem=a(i.elem),parseInt(i.value)!==i.value&&(i.half||(i.value=Math.ceil(i.value)-i.value<.5?Math.ceil(i.value):Math.floor(i.value)));for(var n='<ul class="layui-rate" '+(i.readonly?"readonly":"")+">",u=1;u<=i.length;u++){var r='<li class="layui-inline"><i class="layui-icon '+(u>Math.floor(i.value)?o:s)+'" '+l+"></i></li>";i.half&&parseInt(i.value)!==i.value&&u==Math.ceil(i.value)?n=n+'<li><i class="layui-icon layui-icon-rate-half" '+l+"></i></li>":n+=r}n+="</ul>"+(i.text?'<span class="layui-inline">'+i.value+"星":"")+"</span>";var c=i.elem,f=c.next("."+t);f[0]&&f.remove(),e.elemTemp=a(n),i.span=e.elemTemp.next("span"),i.setText&&i.setText(i.value),c.html(e.elemTemp),c.addClass("layui-inline"),i.readonly||e.action()},v.prototype.setvalue=function(e){var a=this,i=a.config;i.value=e,a.render()},v.prototype.action=function(){var e=this,i=e.config,l=e.elemTemp,n=l.find("i").width();l.children("li").each(function(e){var t=e+1,v=a(this);v.on("click",function(e){if(i.value=t,i.half){var o=e.pageX-a(this).offset().left;o<=n/2&&(i.value=i.value-.5)}i.text&&l.next("span").text(i.value+"星"),i.choose&&i.choose(i.value),i.setText&&i.setText(i.value)}),v.on("mousemove",function(e){if(l.find("i").each(function(){a(this).addClass(o).removeClass(r)}),l.find("i:lt("+t+")").each(function(){a(this).addClass(s).removeClass(f)}),i.half){var c=e.pageX-a(this).offset().left;c<=n/2&&v.children("i").addClass(u).removeClass(s)}}),v.on("mouseleave",function(){l.find("i").each(function(){a(this).addClass(o).removeClass(r)}),l.find("i:lt("+Math.floor(i.value)+")").each(function(){a(this).addClass(s).removeClass(f)}),i.half&&parseInt(i.value)!==i.value&&l.children("li:eq("+Math.floor(i.value)+")").children("i").addClass(u).removeClass(c)})})},v.prototype.events=function(){var e=this;e.config},i.render=function(e){var a=new v(e);return l.call(a)},e(n,i)});
|
@ -1,2 +1,2 @@
|
||||
/** layui-v2.2.3 MIT License By http://www.layui.com */
|
||||
/** layui-v2.3.0 MIT License By https://www.layui.com */
|
||||
;layui.define("jquery",function(e){"use strict";var o=layui.$,a=layui.hint(),i="layui-tree-enter",r=function(e){this.options=e},t={arrow:["",""],checkbox:["",""],radio:["",""],branch:["",""],leaf:""};r.prototype.init=function(e){var o=this;e.addClass("layui-box layui-tree"),o.options.skin&&e.addClass("layui-tree-skin-"+o.options.skin),o.tree(e),o.on(e)},r.prototype.tree=function(e,a){var i=this,r=i.options,n=a||r.nodes;layui.each(n,function(a,n){var l=n.children&&n.children.length>0,c=o('<ul class="'+(n.spread?"layui-show":"")+'"></ul>'),s=o(["<li "+(n.spread?'data-spread="'+n.spread+'"':"")+">",function(){return l?'<i class="layui-icon layui-tree-spread">'+(n.spread?t.arrow[1]:t.arrow[0])+"</i>":""}(),function(){return r.check?'<i class="layui-icon layui-tree-check">'+("checkbox"===r.check?t.checkbox[0]:"radio"===r.check?t.radio[0]:"")+"</i>":""}(),function(){return'<a href="'+(n.href||"javascript:;")+'" '+(r.target&&n.href?'target="'+r.target+'"':"")+">"+('<i class="layui-icon layui-tree-'+(l?"branch":"leaf")+'">'+(l?n.spread?t.branch[1]:t.branch[0]:t.leaf)+"</i>")+("<cite>"+(n.name||"未命名")+"</cite></a>")}(),"</li>"].join(""));l&&(s.append(c),i.tree(c,n.children)),e.append(s),"function"==typeof r.click&&i.click(s,n),i.spread(s,n),r.drag&&i.drag(s,n)})},r.prototype.click=function(e,o){var a=this,i=a.options;e.children("a").on("click",function(e){layui.stope(e),i.click(o)})},r.prototype.spread=function(e,o){var a=this,i=(a.options,e.children(".layui-tree-spread")),r=e.children("ul"),n=e.children("a"),l=function(){e.data("spread")?(e.data("spread",null),r.removeClass("layui-show"),i.html(t.arrow[0]),n.find(".layui-icon").html(t.branch[0])):(e.data("spread",!0),r.addClass("layui-show"),i.html(t.arrow[1]),n.find(".layui-icon").html(t.branch[1]))};r[0]&&(i.on("click",l),n.on("dblclick",l))},r.prototype.on=function(e){var a=this,r=a.options,t="layui-tree-drag";e.find("i").on("selectstart",function(e){return!1}),r.drag&&o(document).on("mousemove",function(e){var i=a.move;if(i.from){var r=(i.to,o('<div class="layui-box '+t+'"></div>'));e.preventDefault(),o("."+t)[0]||o("body").append(r);var n=o("."+t)[0]?o("."+t):r;n.addClass("layui-show").html(i.from.elem.children("a").html()),n.css({left:e.pageX+10,top:e.pageY+10})}}).on("mouseup",function(){var e=a.move;e.from&&(e.from.elem.children("a").removeClass(i),e.to&&e.to.elem.children("a").removeClass(i),a.move={},o("."+t).remove())})},r.prototype.move={},r.prototype.drag=function(e,a){var r=this,t=(r.options,e.children("a")),n=function(){var t=o(this),n=r.move;n.from&&(n.to={item:a,elem:e},t.addClass(i))};t.on("mousedown",function(){var o=r.move;o.from={item:a,elem:e}}),t.on("mouseenter",n).on("mousemove",n).on("mouseleave",function(){var e=o(this),a=r.move;a.from&&(delete a.to,e.removeClass(i))})},e("tree",function(e){var i=new r(e=e||{}),t=o(e.elem);return t[0]?void i.init(t):a.error("layui.tree 没有找到"+e.elem+"元素")})});
|
@ -1,2 +1,2 @@
|
||||
/** layui-v2.2.3 MIT License By http://www.layui.com */
|
||||
;layui.define("jquery",function(e){"use strict";var t=layui.$,i={fixbar:function(e){var i,o,a="layui-fixbar",r="layui-fixbar-top",n=t(document),l=t("body");e=t.extend({showHeight:200},e),e.bar1=e.bar1===!0?"":e.bar1,e.bar2=e.bar2===!0?"":e.bar2,e.bgcolor=e.bgcolor?"background-color:"+e.bgcolor:"";var c=[e.bar1,e.bar2,""],g=t(['<ul class="'+a+'">',e.bar1?'<li class="layui-icon" lay-type="bar1" style="'+e.bgcolor+'">'+c[0]+"</li>":"",e.bar2?'<li class="layui-icon" lay-type="bar2" style="'+e.bgcolor+'">'+c[1]+"</li>":"",'<li class="layui-icon '+r+'" lay-type="top" style="'+e.bgcolor+'">'+c[2]+"</li>","</ul>"].join("")),s=g.find("."+r),u=function(){var t=n.scrollTop();t>=e.showHeight?i||(s.show(),i=1):i&&(s.hide(),i=0)};t("."+a)[0]||("object"==typeof e.css&&g.css(e.css),l.append(g),u(),g.find("li").on("click",function(){var i=t(this),o=i.attr("lay-type");"top"===o&&t("html,body").animate({scrollTop:0},200),e.click&&e.click.call(this,o)}),n.on("scroll",function(){clearTimeout(o),o=setTimeout(function(){u()},100)}))},countdown:function(e,t,i){var o=this,a="function"==typeof t,r=new Date(e).getTime(),n=new Date(!t||a?(new Date).getTime():t).getTime(),l=r-n,c=[Math.floor(l/864e5),Math.floor(l/36e5)%24,Math.floor(l/6e4)%60,Math.floor(l/1e3)%60];a&&(i=t);var g=setTimeout(function(){o.countdown(e,n+1e3,i)},1e3);return i&&i(l>0?c:[0,0,0,0],t,g),l<=0&&clearTimeout(g),g},timeAgo:function(e,t){var i=this,o=[[],[]],a=(new Date).getTime()-new Date(e).getTime();return a>6912e5?(a=new Date(e),o[0][0]=i.digit(a.getFullYear(),4),o[0][1]=i.digit(a.getMonth()+1),o[0][2]=i.digit(a.getDate()),t||(o[1][0]=i.digit(a.getHours()),o[1][1]=i.digit(a.getMinutes()),o[1][2]=i.digit(a.getSeconds())),o[0].join("-")+" "+o[1].join(":")):a>=864e5?(a/1e3/60/60/24|0)+"天前":a>=36e5?(a/1e3/60/60|0)+"小时前":a>=12e4?(a/1e3/60|0)+"分钟前":a<0?"未来":"刚刚"},digit:function(e,t){var i="";e=String(e),t=t||2;for(var o=e.length;o<t;o++)i+="0";return e<Math.pow(10,t)?i+(0|e):e},toDateString:function(e,t){var i=this,o=new Date(e||new Date),a=[i.digit(o.getFullYear(),4),i.digit(o.getMonth()+1),i.digit(o.getDate())],r=[i.digit(o.getHours()),i.digit(o.getMinutes()),i.digit(o.getSeconds())];return t=t||"yyyy-MM-dd HH:mm:ss",t.replace(/yyyy/g,a[0]).replace(/MM/g,a[1]).replace(/dd/g,a[2]).replace(/HH/g,r[0]).replace(/mm/g,r[1]).replace(/ss/g,r[2])}};e("util",i)});
|
||||
/** layui-v2.3.0 MIT License By https://www.layui.com */
|
||||
;layui.define("jquery",function(e){"use strict";var t=layui.$,i={fixbar:function(e){var i,a,o="layui-fixbar",r="layui-fixbar-top",l=t(document),n=t("body");e=t.extend({showHeight:200},e),e.bar1=e.bar1===!0?"":e.bar1,e.bar2=e.bar2===!0?"":e.bar2,e.bgcolor=e.bgcolor?"background-color:"+e.bgcolor:"";var c=[e.bar1,e.bar2,""],g=t(['<ul class="'+o+'">',e.bar1?'<li class="layui-icon" lay-type="bar1" style="'+e.bgcolor+'">'+c[0]+"</li>":"",e.bar2?'<li class="layui-icon" lay-type="bar2" style="'+e.bgcolor+'">'+c[1]+"</li>":"",'<li class="layui-icon '+r+'" lay-type="top" style="'+e.bgcolor+'">'+c[2]+"</li>","</ul>"].join("")),u=g.find("."+r),s=function(){var t=l.scrollTop();t>=e.showHeight?i||(u.show(),i=1):i&&(u.hide(),i=0)};t("."+o)[0]||("object"==typeof e.css&&g.css(e.css),n.append(g),s(),g.find("li").on("click",function(){var i=t(this),a=i.attr("lay-type");"top"===a&&t("html,body").animate({scrollTop:0},200),e.click&&e.click.call(this,a)}),l.on("scroll",function(){clearTimeout(a),a=setTimeout(function(){s()},100)}))},countdown:function(e,t,i){var a=this,o="function"==typeof t,r=new Date(e).getTime(),l=new Date(!t||o?(new Date).getTime():t).getTime(),n=r-l,c=[Math.floor(n/864e5),Math.floor(n/36e5)%24,Math.floor(n/6e4)%60,Math.floor(n/1e3)%60];o&&(i=t);var g=setTimeout(function(){a.countdown(e,l+1e3,i)},1e3);return i&&i(n>0?c:[0,0,0,0],t,g),n<=0&&clearTimeout(g),g},timeAgo:function(e,t){var i=this,a=[[],[]],o=(new Date).getTime()-new Date(e).getTime();return o>6912e5?(o=new Date(e),a[0][0]=i.digit(o.getFullYear(),4),a[0][1]=i.digit(o.getMonth()+1),a[0][2]=i.digit(o.getDate()),t||(a[1][0]=i.digit(o.getHours()),a[1][1]=i.digit(o.getMinutes()),a[1][2]=i.digit(o.getSeconds())),a[0].join("-")+" "+a[1].join(":")):o>=864e5?(o/1e3/60/60/24|0)+"天前":o>=36e5?(o/1e3/60/60|0)+"小时前":o>=12e4?(o/1e3/60|0)+"分钟前":o<0?"未来":"刚刚"},digit:function(e,t){var i="";e=String(e),t=t||2;for(var a=e.length;a<t;a++)i+="0";return e<Math.pow(10,t)?i+(0|e):e},toDateString:function(e,t){var i=this,a=new Date(e||new Date),o=[i.digit(a.getFullYear(),4),i.digit(a.getMonth()+1),i.digit(a.getDate())],r=[i.digit(a.getHours()),i.digit(a.getMinutes()),i.digit(a.getSeconds())];return t=t||"yyyy-MM-dd HH:mm:ss",t.replace(/yyyy/g,o[0]).replace(/MM/g,o[1]).replace(/dd/g,o[2]).replace(/HH/g,r[0]).replace(/mm/g,r[1]).replace(/ss/g,r[2])},escape:function(e){return String(e||"").replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""")}};e("util",i)});
|
@ -1,4 +1,4 @@
|
||||
/**
|
||||
/**
|
||||
|
||||
@Name: Fly社区主入口
|
||||
|
||||
@ -22,6 +22,11 @@ layui.define(['layer', 'laytpl', 'form', 'element', 'upload', 'util', 'face'], f
|
||||
if(device.ie && device.ie < 8){
|
||||
layer.alert('如果您非得使用 IE 浏览器访问社区,那么请使用 IE8+');
|
||||
}
|
||||
//1216.top都统一访问到www.1216.top; 考虑SEO
|
||||
var addr = window.location.href
|
||||
if(addr.indexOf("1216.top") > -1 && addr.indexOf("www.1216.top") == -1){
|
||||
window.location.href = addr.replace("1216.top", "www.1216.top");
|
||||
}
|
||||
|
||||
layui.focusInsert = function(obj, str){
|
||||
var result, val = obj.value;
|
||||
@ -641,7 +646,7 @@ layui.define(['layer', 'laytpl', 'form', 'element', 'upload', 'util', 'face'], f
|
||||
});
|
||||
|
||||
//固定Bar
|
||||
util.fixbar({
|
||||
/*util.fixbar({
|
||||
bar1: ''
|
||||
,bgcolor: '#4a184c'
|
||||
,click: function(type){
|
||||
@ -650,7 +655,7 @@ layui.define(['layer', 'laytpl', 'form', 'element', 'upload', 'util', 'face'], f
|
||||
location.href = '/jie/add';
|
||||
}
|
||||
}
|
||||
});
|
||||
});*/
|
||||
|
||||
exports('fly', fly);
|
||||
|
||||
|
@ -25,7 +25,7 @@ public class FileService extends BaseService {
|
||||
String name = tmpFile.getName();
|
||||
String suffix = name.substring(name.lastIndexOf("."));
|
||||
String path = String.format(format, System.currentTimeMillis()) + suffix;
|
||||
File destFile = new File((winos ? "E:/wk/redbbs/root/tem/" : dir) + path);
|
||||
File destFile = new File((winos ? "D:/wk/_own/redbbs/root/tem/" : dir) + path);
|
||||
destFile.getParentFile().mkdir();
|
||||
if (!tmpFile.renameTo(destFile)){
|
||||
try{
|
||||
|
13
src/com/lxyer/bbs/mail/MailService.java
Normal file
@ -0,0 +1,13 @@
|
||||
package com.lxyer.bbs.mail;
|
||||
|
||||
import com.lxyer.bbs.base.BaseService;
|
||||
|
||||
/**
|
||||
* 邮件服务
|
||||
* Created by liangxianyou at 2018/5/13 9:45.
|
||||
*/
|
||||
public class MailService extends BaseService {
|
||||
|
||||
|
||||
|
||||
}
|
84
src/com/lxyer/bbs/weixin/WeiXinService.java
Normal file
@ -0,0 +1,84 @@
|
||||
package com.lxyer.bbs.weixin;
|
||||
|
||||
import com.lxyer.bbs.base.BaseService;
|
||||
import com.lxyer.bbs.base.user.UserService;
|
||||
import com.lxyer.bbs.comment.CommentService;
|
||||
import com.lxyer.bbs.content.ContentService;
|
||||
import org.redkale.net.http.RestMapping;
|
||||
import org.redkale.net.http.RestService;
|
||||
import org.redkale.util.Utility;
|
||||
import org.redkalex.cache.RedisCacheSource;
|
||||
import org.redkalex.weixin.WeiXinMPService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.File;
|
||||
import java.security.MessageDigest;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* Created by JUECHENG at 2018/1/12 0:14.
|
||||
*/
|
||||
@RestService(name = "wx",automapping = true, comment = "微信管理")
|
||||
public class WeiXinService extends BaseService{
|
||||
|
||||
private String mptoken = "redbbs_dev";
|
||||
|
||||
@Resource(name = "redis")
|
||||
private RedisCacheSource cacheSource;
|
||||
|
||||
//用于微信登录
|
||||
@Resource
|
||||
private WeiXinMPService wxService;
|
||||
|
||||
@Resource
|
||||
private ContentService contentService;
|
||||
@Resource
|
||||
private CommentService commentService;
|
||||
@Resource
|
||||
private UserService userService;
|
||||
|
||||
@Resource(name = "SERVER_ROOT")
|
||||
protected File webroot;
|
||||
|
||||
|
||||
|
||||
@RestMapping(name = "verifyMPURL",auth = false, comment = "微信域名验证")
|
||||
public long verifyMPURL(String msgSignature, String timeStamp, String nonce, String echoStr) {
|
||||
|
||||
String o = cacheSource.getString("300");
|
||||
|
||||
cacheSource.set("t", "");
|
||||
long d = cacheSource.getLong("d", 0);
|
||||
|
||||
|
||||
cacheSource.incr("d");
|
||||
cacheSource.setExpireSeconds("d", 5);
|
||||
|
||||
Object t = cacheSource.getString("t");
|
||||
|
||||
|
||||
/*String signature = sha1(mptoken, timeStamp, nonce);
|
||||
if (!signature.equals(msgSignature)) throw new RuntimeException("signature verification error");
|
||||
return echoStr;*/
|
||||
return d;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 用SHA1算法生成安全签名
|
||||
* <p>
|
||||
* @param strings String[]
|
||||
*
|
||||
* @return 安全签名
|
||||
*/
|
||||
protected static String sha1(String... strings) {
|
||||
try {
|
||||
Arrays.sort(strings);
|
||||
MessageDigest md = MessageDigest.getInstance("SHA-1");
|
||||
for (String s : strings) md.update(s.getBytes());
|
||||
return Utility.binToHexString(md.digest());
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("SHA encryption to generate signature failure", e);
|
||||
}
|
||||
}
|
||||
}
|
16
src/com/lxyer/redim/RedbbsListener.java
Normal file
@ -0,0 +1,16 @@
|
||||
package com.lxyer.redim;
|
||||
|
||||
import com.lxyer.redim.impl.ImFriendServiceImpl;
|
||||
import org.redkale.boot.Application;
|
||||
import org.redkale.boot.ApplicationListener;
|
||||
|
||||
/**
|
||||
* @author: liangxianyou at 2018/8/10 22:51.
|
||||
*/
|
||||
public class RedbbsListener implements ApplicationListener {
|
||||
|
||||
@Override
|
||||
public void preStart(Application application) {
|
||||
ImFriendServiceImpl.application = application;
|
||||
}
|
||||
}
|
122
src/com/lxyer/redim/impl/ImFriendServiceImpl.java
Normal file
@ -0,0 +1,122 @@
|
||||
package com.lxyer.redim.impl;
|
||||
|
||||
import com.jfinal.kit.Kv;
|
||||
import com.lxyer.base.JBean;
|
||||
import com.lxyer.bbs.base.BaseService;
|
||||
import com.lxyer.bbs.base.user.UserInfo;
|
||||
import com.lxyer.bbs.base.user.UserRecord;
|
||||
import com.lxyer.bbs.base.user.UserService;
|
||||
import com.lxyer.redim.service.ImFriendService;
|
||||
import org.redkale.boot.Application;
|
||||
import org.redkale.net.TransportFactory;
|
||||
import org.redkale.net.TransportGroupInfo;
|
||||
import org.redkale.net.http.RestService;
|
||||
import org.redkale.source.FilterExpress;
|
||||
import org.redkale.source.FilterNode;
|
||||
import org.redkale.util.ResourceType;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ResourceType(ImFriendService.class)
|
||||
@RestService(name = "imfriend",automapping = true, comment = "好友管理")
|
||||
public class ImFriendServiceImpl extends BaseService implements ImFriendService {
|
||||
|
||||
@Resource
|
||||
UserService userService;
|
||||
|
||||
@Resource
|
||||
TransportFactory transportFactory;
|
||||
|
||||
@Resource
|
||||
public static Application application;
|
||||
|
||||
@Override
|
||||
public JBean friends(String sessionid) {
|
||||
List<UserRecord> records = source.queryList(UserRecord.class, FilterNode.create("status", FilterExpress.NOTEQUAL, -10));
|
||||
|
||||
Kv data = Kv.create();
|
||||
|
||||
//mine
|
||||
Kv mine = Kv.by("username", "游客").set("id", "0").set("sign","").set("status", "online").set("avatar", "/res/images/avatar/13.jpg");
|
||||
UserInfo userInfo = userService.current(sessionid);
|
||||
if (userInfo != null){
|
||||
mine.set("username", userInfo.getNickname());
|
||||
mine.set("id", userInfo.getUserid());
|
||||
mine.set("sign", userInfo.getSign());
|
||||
mine.set("avatar", userInfo.getAvatar());
|
||||
mine.set("status", "online");
|
||||
}
|
||||
|
||||
//friend
|
||||
List<Kv> friend = new ArrayList<>();
|
||||
List<Kv> group = new ArrayList<>();
|
||||
|
||||
List list = new ArrayList();
|
||||
records.forEach(x->{
|
||||
Kv _friend = Kv.by("id", x.getUserid());
|
||||
_friend.set("username", x.getNickname());
|
||||
_friend.set("sign", x.getSign());
|
||||
_friend.set("avatar", x.getAvatar());
|
||||
_friend.set("status", "online");
|
||||
list.add(_friend);
|
||||
});
|
||||
|
||||
friend.add(Kv.by("groupname", "默认分组").set("id", 1).set("online", list.size()).set("list", list));
|
||||
group.add(Kv.by("groupname", "默认分组").set("id", 1).set("avatar", "/res/images/avatar/13.jpg"));
|
||||
|
||||
data.set("mine", mine).set("friend", friend).set("group", group);
|
||||
|
||||
return JBean.by(Kv.by("code", 0).set("msg", "").set("data", data));
|
||||
}
|
||||
|
||||
@Override
|
||||
public JBean friendList(String sessionid) {
|
||||
|
||||
/*SncpClient sncpClient = new SncpClient("", ImFriendService.class, this, transportFactory,
|
||||
true, this.getClass(), new InetSocketAddress("192.168.227.1", 7070));*/
|
||||
|
||||
|
||||
TransportFactory sncpTransportFactory = application.getSncpTransportFactory();
|
||||
TransportGroupInfo groupInfo = sncpTransportFactory.findGroupInfo("ALL");
|
||||
|
||||
System.out.println(groupInfo.toString());
|
||||
|
||||
groupInfo.putAddress(new InetSocketAddress("120.24.230.60", 7070));
|
||||
|
||||
|
||||
//sncpTransportFactory.addGroupInfo(groupInfo);
|
||||
|
||||
|
||||
|
||||
return friends(sessionid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JBean groups(String sessionid) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JBean itemSave(String sessionid) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JBean addFriend(String sessionid) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JBean groupSave(String sessionid) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JBean addGroup(String sessionid) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
93
src/com/lxyer/redim/impl/ImMsgServiceImpl.java
Normal file
@ -0,0 +1,93 @@
|
||||
package com.lxyer.redim.impl;
|
||||
|
||||
import com.lxyer.base.JBean;
|
||||
import com.lxyer.bbs.base.BaseService;
|
||||
import com.lxyer.bbs.base.user.UserRecord;
|
||||
import com.lxyer.redim.entity.MsgRecord;
|
||||
import com.lxyer.redim.info.MsgInfo;
|
||||
import com.lxyer.redim.service.ImMsgService;
|
||||
import org.redkale.net.http.RestService;
|
||||
import org.redkale.source.FilterNode;
|
||||
import org.redkale.util.ResourceType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author: liangxianyou at 2018/8/12 13:10.
|
||||
*/
|
||||
@ResourceType(ImMsgService.class)
|
||||
@RestService(name = "immsg",automapping = true, comment = "聊天记录管理")
|
||||
public class ImMsgServiceImpl extends BaseService implements ImMsgService {
|
||||
|
||||
/**
|
||||
* 消息入库
|
||||
*
|
||||
* @param msg
|
||||
*/
|
||||
@Override
|
||||
public JBean insert(MsgRecord... msg) {
|
||||
source.insertAsync(msg);
|
||||
return JBean.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 消息修改
|
||||
*
|
||||
* @param msg
|
||||
*/
|
||||
@Override
|
||||
public JBean update(MsgRecord ... msg) {
|
||||
source.updateAsync(msg);
|
||||
return JBean.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 历史消息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public JBean list() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建消息体
|
||||
*
|
||||
* @param msg
|
||||
*/
|
||||
@Override
|
||||
public JBean<MsgInfo> createMsgInfo(MsgRecord msg) {
|
||||
MsgInfo info = new MsgInfo();
|
||||
int fromuserid = msg.getFromuserid();
|
||||
|
||||
UserRecord userRecord;
|
||||
if (fromuserid > 0){
|
||||
userRecord = source.find(UserRecord.class, fromuserid);
|
||||
info.setUsername(userRecord.getUsername());
|
||||
info.setAvatar(userRecord.getAvatar());
|
||||
info.setType("friend");
|
||||
}else {
|
||||
info.setUsername("游客");
|
||||
info.setAvatar("/res/images/avatar/12.jpg");
|
||||
info.setType("friend");
|
||||
}
|
||||
|
||||
info.setId(msg.getFromuserid());
|
||||
info.setContent(msg.getContent());
|
||||
info.setCid(msg.getMsgid());
|
||||
info.setMine(false);
|
||||
info.setFromid(msg.getFromuserid());
|
||||
info.setTimestamp(msg.getCreatetime());
|
||||
|
||||
return JBean.by(info);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JBean<List<MsgRecord>> offlineMsg(int userid) {
|
||||
List<MsgRecord> records = source.queryList(MsgRecord.class, FilterNode.create("touserid", userid).and("status", 10));
|
||||
return JBean.by(records);
|
||||
}
|
||||
|
||||
|
||||
}
|
1
tmp/excel/tmp_cp.xls
Normal file
68
work_redbbs.md
Normal file
@ -0,0 +1,68 @@
|
||||
======================
|
||||
redbbs
|
||||
redoss
|
||||
redbbs-app
|
||||
redim
|
||||
redtimer
|
||||
redexcel
|
||||
jfly
|
||||
|
||||
待办:
|
||||
1、redtimer 文档编写
|
||||
|
||||
|
||||
# redbbs
|
||||
|
||||
1. √文章编辑加入未保存浏览器缓存
|
||||
2. √文章编辑标题加入长度检查
|
||||
3. 注册邮箱验证--
|
||||
4. √加入管理员功能
|
||||
5. 丰富个人中心
|
||||
6. 加入资源模块--
|
||||
7. √|-|管理员浏览文章阅读数不做增长
|
||||
8. √个人中心-收藏数据不对
|
||||
9. √管理员查询不到用户未公开帖子
|
||||
10. √注册/资料修改 成功后未提示
|
||||
11. √首页帖子用户头像链接地址错误
|
||||
12. +帖子访客记录
|
||||
13. 指定好友帖子权限--指定好友可见
|
||||
14. ~项目更新记录页使用时光线展示
|
||||
15. +SEO设置
|
||||
16. +标签
|
||||
17. +访问日志记录
|
||||
18. +管理后台
|
||||
19. +读书频道
|
||||
20. +网站自动升级功能
|
||||
21. +灵感说
|
||||
22. +工作簿
|
||||
|
||||
|
||||
社区升级
|
||||
1、表字段统一小写,
|
||||
2、表模块划分
|
||||
3、表状态等字段统一smallint
|
||||
4、部分字段值重新定义
|
||||
|
||||
升级程序实录:
|
||||
1.导出表结构
|
||||
mysqldump -u root -d -p redbbs > redbbs-t-06.17.sql
|
||||
2.导出数据
|
||||
mysqldump -u root -t -p redbbs > redbbs-t-06.17.sql
|
||||
3.创建数据库
|
||||
create database redbbs_dev default charset utf8;
|
||||
4.导入数据库
|
||||
mysql -u root -p redbbs_dev < redbbs-t-06.17.sql
|
||||
|
||||
|
||||
echo '[mongodb-org-3.6]
|
||||
name=MongoDB Repository
|
||||
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.6/x86_64/
|
||||
gpgcheck=1
|
||||
enabled=1
|
||||
gpgkey=https://www.mongodb.org/static/pgp/server-3.6.asc'
|
||||
>> /etc/yum.repos.d/mongodb-org-3.6.repo
|
||||
|
||||
灵感说功能
|
||||
|
||||
|
||||
|