提交 f939048e 编写于 作者: doc_wei's avatar doc_wei

userToken整改

上级 df4368fe
......@@ -134,7 +134,7 @@ function loadUploadMethod(){
}});
}
});
// 实例化
uploader = WebUploader.create({
pick: {
......@@ -142,7 +142,6 @@ function loadUploadMethod(){
label: '选择文件'
},
formData: {
userToken: getCookie('userToken'),
loginPCIp: returnCitySN["cip"],
folderId: folderId
},
......@@ -209,7 +208,7 @@ function loadUploadMethod(){
});
uploader.on('uploadBeforeSend', function(block, data, headers) {
headers['X-Requested-With']= 'XMLHttpRequest';
data.userToken = getCookie('userToken');
$.extend(headers, getRequestHeaders());
data.loginPCIp = returnCitySN["cip"];
data.folderId = folderId;
data.md5 = md5;
......
......@@ -81,10 +81,10 @@ function createHtmlFile(folderId, callBack){
}
// 创建文件夹
function createFolder(folderId, refreshCallBack, initDragCallBack){
function createFolder(folderId, refreshCallBack, initDragCallBack, currentUserId){
AjaxPostUtil.request({url:reqBasePath + "fileconsole002", params: {parentId: folderId, catalogName: '新建文件夹'}, type: 'json', callback: function(json){
if(json.returnCode == 0){
initNewFolder(json.bean.id, json.bean.catalogName, json.bean.logoPath, true);
initNewFolder(json.bean.id, json.bean.catalogName, json.bean.logoPath, true, currentUserId);
// 刷新节点
if(typeof(refreshCallBack) == "function") {
refreshCallBack();
......@@ -100,7 +100,7 @@ function createFolder(folderId, refreshCallBack, initDragCallBack){
}
// 加载新建的文件夹
function initNewFolder(id, folderName, icon, isEdit){
function initNewFolder(id, folderName, icon, isEdit, currentUserId){
$("#file-content").find("div[class='filename-edit']").hide();
$("#file-content").find("div[class='filename']").show();
var json = {
......@@ -109,7 +109,7 @@ function initNewFolder(id, folderName, icon, isEdit){
name: folderName,
icon: icon,
isShow: 'none',
createId: getCookie('userToken')
createId: currentUserId
}
};
var html = getDataUseHandlebars(folderTemplate, json);
......
......@@ -746,14 +746,14 @@ layui.config({
// 新建文件夹
$("body").on("click", "#createNewFolder", function(e){
hideRMenu();
createFolder(folderId, refreshTreePointNode, initMenuToBox);
createFolder(folderId, refreshTreePointNode, initMenuToBox, currentUserId);
});
// 树操作--新建文件夹
$("body").on("click", ".treecreateNewFolder", function(e){
hideRMenu();
loadThisFolderChild();
createFolder(folderId, refreshTreePointNode, initMenuToBox);
createFolder(folderId, refreshTreePointNode, initMenuToBox, currentUserId);
});
// 树操作--刷新
......@@ -1464,7 +1464,7 @@ layui.config({
text: "新建文件夹",
img: "../../assets/images/create-folder-icon.png",
callback: function() {
createFolder(folderId, refreshTreePointNode, initMenuToBox);
createFolder(folderId, refreshTreePointNode, initMenuToBox, currentUserId);
}
}, { // 菜单项
text: "新建文件",
......@@ -1792,7 +1792,6 @@ layui.config({
// 实例化
uploader = WebUploader.create({
formData: {
userToken: getCookie('userToken'),
loginPCIp: returnCitySN["cip"],
folderId: folderId
},
......@@ -1858,7 +1857,7 @@ layui.config({
});
uploader.on('uploadBeforeSend', function(block, data, headers) {
headers['X-Requested-With']= 'XMLHttpRequest';
data.userToken = getCookie('userToken');
$.extend(headers, getRequestHeaders());
data.loginPCIp = returnCitySN["cip"];
data.folderId = folderId;
data.md5 = md5;
......
......@@ -133,7 +133,6 @@ function loadUploadMethod(){
label: '选择文件'
},
formData: {
userToken: getCookie('userToken'),
loginPCIp: returnCitySN["cip"],
folderId: parent.folderId
},
......@@ -200,7 +199,7 @@ function loadUploadMethod(){
});
uploader.on('uploadBeforeSend', function(block, data, headers) {
headers['X-Requested-With']= 'XMLHttpRequest';
data.userToken = getCookie('userToken');
$.extend(headers, getRequestHeaders());
data.loginPCIp = returnCitySN["cip"];
data.folderId = parent.folderId;
data.md5 = md5;
......
......@@ -134,7 +134,6 @@ function loadUploadMethod(){
webkitdirectory: true
},
formData: {
userToken: getCookie('userToken'),
loginPCIp: returnCitySN["cip"],
folderId: parent.folderId
},
......@@ -201,7 +200,7 @@ function loadUploadMethod(){
});
uploader.on('uploadBeforeSend', function(block, data, headers) {
headers['X-Requested-With']= 'XMLHttpRequest';
data.userToken = getCookie('userToken');
$.extend(headers, getRequestHeaders());
data.loginPCIp = returnCitySN["cip"];
data.folderId = parent.folderId;
data.md5 = md5;
......
......@@ -58,21 +58,17 @@ layui.config({
//加载用户信息
function loadUserMation(){
if(!isNull(getCookie('userToken'))){
// 获取当前登录员工信息
systemCommonUtil.getSysCurrentLoginUserMation(function (data){
var str = '<img alt="' + data.bean.userName + '" src="' + fileBasePath + data.bean.userPhoto + '"/>'
+ '<font>' + data.bean.userName + '</font>'
+ '<font id="consoleDesk">控制台</font>'
+ '<font id="exitBtn">退出</font>';
$("#operatorBtn").html(str);
$("#file-operator").html('<button class="layui-btn layui-btn-primary" id="saveBtn"><language showName="com.skyeye.save"></language></button>');
}, function (){
$("#operatorBtn").html('<font id="loginBtn">登陆</font>');
});
}else{
// 获取当前登录员工信息
systemCommonUtil.getSysCurrentLoginUserMation(function (data){
var str = '<img alt="' + data.bean.userName + '" src="' + fileBasePath + data.bean.userPhoto + '"/>'
+ '<font>' + data.bean.userName + '</font>'
+ '<font id="consoleDesk">控制台</font>'
+ '<font id="exitBtn">退出</font>';
$("#operatorBtn").html(str);
$("#file-operator").html('<button class="layui-btn layui-btn-primary" id="saveBtn"><language showName="com.skyeye.save"></language></button>');
}, function (){
$("#operatorBtn").html('<font id="loginBtn">登陆</font>');
}
});
loadFileMation();
}
......
......@@ -9,10 +9,8 @@ layui.config({
}).extend({
window: 'js/winui.window'
}).define(['window', 'jquery', 'winui'], function (exports) {
winui.renderColor();
var $ = layui.$;
var commentTemplate = $('#commentTemplate').html();
var replyTemplate = $('#replyTemplate').html();
var textareaTemplate = $('#textareaTemplate').html();
......@@ -23,12 +21,18 @@ layui.config({
$("body").append(getFileContent("tpl/forumshow/commonmenu.tpl"));
rowId = GetUrlParam("id");
var userToken = getCookie('userToken');
var currentUserId = "";
// 获取当前登录员工信息
systemCommonUtil.getSysCurrentLoginUserMation(function (data){
currentUserId = data.bean.id;
});
//帖子信息展示
AjaxPostUtil.request({url:reqBasePath + "forumcontent006", params: {rowId:rowId}, type: 'json', callback: function(json){
if(json.returnCode == 0){
if(json.bean.createId != userToken){//如果不是用户自己的帖子,则显示举报按钮
if(json.bean.createId != currentUserId){
// 如果不是用户自己的帖子,则显示举报按钮
$("#forumReport").removeClass("layui-hide");
}
$("#content").html(json.bean.content);
......
......@@ -133,7 +133,6 @@ function loadUploadMethod(){
label: '选择文件',
},
formData: {
userToken: getCookie('userToken'),
loginPCIp: returnCitySN["cip"],
},
dnd: '#uploader .queueList',
......@@ -204,7 +203,7 @@ function loadUploadMethod(){
});
uploader.on('uploadBeforeSend', function(block, data, headers) {
headers['X-Requested-With']= 'XMLHttpRequest';
data.userToken = getCookie('userToken');
$.extend(headers, getRequestHeaders());
data.loginPCIp = returnCitySN["cip"];
data.md5 = md5;
data.chunk = block.chunk;
......
......@@ -20,19 +20,17 @@ layui.config({
loadUserMation();
function loadUserMation(){
if(!isNull(getCookie('userToken'))){
// 获取当前登录员工信息
systemCommonUtil.getSysCurrentLoginUserMation(function (data){
var str = '<img alt="' + data.bean.userName + '" src="' + fileBasePath + data.bean.userPhoto + '"/>'
+ '<font>' + data.bean.userName + '</font>'
+ '<font id="consoleDesk">控制台</font>'
+ '<font id="exitBtn">退出</font>';
$("#operatorBtn").html(str);
loadNote();
});
}else{
// 获取当前登录员工信息
systemCommonUtil.getSysCurrentLoginUserMation(function (data){
var str = '<img alt="' + data.bean.userName + '" src="' + fileBasePath + data.bean.userPhoto + '"/>'
+ '<font>' + data.bean.userName + '</font>'
+ '<font id="consoleDesk">控制台</font>'
+ '<font id="exitBtn">退出</font>';
$("#operatorBtn").html(str);
loadNote();
}, function (){
location.href = "../../tpl/index/login.html?url=" + escape("../../tpl/note/shareNote.html?id=" + rowId);
}
});
}
function loadNote(){
......
......@@ -141,8 +141,8 @@ layui.define(['jquery','layer','element','form'], function(exports) {
request : function(config) {
var data = config.data ? config.data : {};
var async = (typeof (config.async) === "boolean") ? config.async : true;
data.userToken = getCookie('userToken');
data.loginPCIp = returnCitySN["cip"];
$.extend(config.headers, getRequestHeaders());
$.ajax({
type : config.type ? config.type : "POST",
headers : config.headers,
......
......@@ -1486,12 +1486,12 @@ layui.config({}).extend({}).define(['laytpl', 'laypage', 'layer', 'form'], funct
params[request.limitName] = options.limit;
that.filterRulesSet(params); //行内过滤条件
that.sortSet(params); //排序条件
options.where.userToken = getCookie('userToken');
options.where.loginPCIp = returnCitySN["cip"];
$.ajax({
type: options.method || 'get',
url: options.url,
data: $.extend(params, options.where),
headers: getRequestHeaders(),
dataType: 'json',
success: function(res) {
//移除请求遮罩层
......
......@@ -640,7 +640,7 @@ layui.define(['layer', 'winui'], function (exports) {
id: 'winui-sys-notice',
type: 2,
title: title,
content: '../../tpl/mymessage/myNoticeList.html?userToken=' + getCookie("userToken"),
content: '../../tpl/mymessage/myNoticeList.html',
loadBottomMenuIcon: loadBottomMenuIcon,
iconTitle: iconTitle
});
......
......@@ -261,7 +261,6 @@ function loadUploadMethod(){
label: '选择文件'
},
formData: {
userToken: getCookie('userToken'),
loginPCIp: returnCitySN["cip"],
folderId: folderId
},
......@@ -328,7 +327,7 @@ function loadUploadMethod(){
});
uploader.on('uploadBeforeSend', function(block, data, headers) {
headers['X-Requested-With']= 'XMLHttpRequest';
data.userToken = getCookie('userToken');
$.extend(headers, getRequestHeaders());
data.loginPCIp = returnCitySN["cip"];
data.folderId = folderId;
data.md5 = md5;
......
......@@ -546,11 +546,11 @@ layui.config({
title: '天眼',
init: {
url: reqBasePath + "companychat001",
data: {userToken: getCookie('userToken'), loginPCIp: returnCitySN["cip"]}
data: {loginPCIp: returnCitySN["cip"]}
},//好友接口
members: {
url: reqBasePath + 'companytalkgroup007',
data: {userToken: getCookie('userToken'), loginPCIp: returnCitySN["cip"]}
data: {loginPCIp: returnCitySN["cip"]}
},//群员借口
uploadImage: {
url: reqBasePath + "common003?type=9", //(返回的数据格式见下文)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册