Browse Source

巡检大屏登录

master
wenlele 10 months ago
parent
commit
7ce021c696
  1. 353
      api/app/lib/controllers/auth/index.js
  2. 138
      api/app/lib/controllers/projectManagement/projectPublish.js
  3. 2
      api/app/lib/middlewares/authenticator.js
  4. 4
      api/app/lib/routes/auth/index.js
  5. 12
      web-screen/client/src/layout/components/sider/index.js
  6. 86
      web-screen/client/src/sections/auth/actions/auth.js
  7. 47
      web-screen/client/src/sections/auth/containers/login.js
  8. 2
      web-screen/client/src/sections/auth/reducers/auth.js
  9. 4
      web-screen/client/src/utils/webapi.js
  10. 12
      web/client/src/layout/components/sider/index.js
  11. 4
      web/client/src/sections/auth/actions/auth.js
  12. 13
      web/client/src/sections/projectManagement/actions/projectPublish.js
  13. 2
      web/client/src/sections/projectManagement/containers/projectPublish.js

353
api/app/lib/controllers/auth/index.js

@ -5,157 +5,226 @@ const MD5 = require('crypto-js/md5');
const moment = require('moment');
const uuid = require('uuid');
async function login(ctx, next) {
const transaction = await ctx.fs.dc.orm.transaction();
try {
const models = ctx.fs.dc.models;
const params = ctx.request.body;
let password = Hex.stringify(MD5(params.password));
const userRes = await models.User.findOne({
where: {
username: params.username,
password: password,
delete: false,
enable: true
},
attributes: { exclude: ['password'] },
include: [{
attributes: ["resourceId"],
model: models.UserResource
}]
});
if (!userRes) {
async function login (ctx, next) {
const transaction = await ctx.fs.dc.orm.transaction();
try {
const models = ctx.fs.dc.models;
const params = ctx.request.body;
let password = Hex.stringify(MD5(params.password));
const userRes = await models.User.findOne({
where: {
username: params.username,
password: password,
delete: false,
enable: true
},
attributes: { exclude: ['password'] },
include: [{
attributes: ["resourceId"],
model: models.UserResource
}]
});
if (!userRes) {
ctx.status = 400;
ctx.body = {
"message": "账号或密码错误"
}
}
if (userRes)
if (userRes && !userRes.enable) {
ctx.status = 400;
ctx.body = {
"message": "账号或密码错误"
ctx.body = { message: "该用户已被禁用" }
} else {
const token = uuid.v4();
let deptInfo = null;
if (userRes) {
const { departmentId } = userRes.dataValues;
deptInfo = await models.Department.findOne({
where: {
id: departmentId
}
})
}
}
if (userRes)
if (userRes && !userRes.enable) {
ctx.status = 400;
ctx.body = { message: "该用户已被禁用" }
} else {
const token = uuid.v4();
let deptInfo = null;
if (userRes) {
const { departmentId } = userRes.dataValues;
deptInfo = await models.Department.findOne({
where: {
id: departmentId
}
})
}
if (!userRes) {
ctx.status = 400;
ctx.body = { message: "暂无登录权限,请联系管理员" }
return;
}
let userData = userRes.dataValues;
let userRslt = Object.assign(userData, {
authorized: true,
token: token,
userResources: userRes ? userRes.userResources.map(r => r.resourceId) : [],
type: deptInfo ? deptInfo.type : '',
deptName: deptInfo ? deptInfo.name : '',
});
await models.UserToken.create({
token: token,
userInfo: userRslt,
expired: moment().add(30, 'days').format()
});
ctx.status = 200;
ctx.body = userRslt;
if (!userRes) {
ctx.status = 400;
ctx.body = { message: "暂无登录权限,请联系管理员" }
return;
}
await transaction.commit();
} catch (error) {
await transaction.rollback();
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = {
"message": "登录失败"
}
}
let userData = userRes.dataValues;
let userRslt = Object.assign(userData, {
authorized: true,
token: token,
userResources: userRes ? userRes.userResources.map(r => r.resourceId) : [],
type: deptInfo ? deptInfo.type : '',
deptName: deptInfo ? deptInfo.name : '',
});
await models.UserToken.create({
token: token,
userInfo: userRslt,
expired: moment().add(30, 'days').format()
});
ctx.status = 200;
ctx.body = userRslt;
}
await transaction.commit();
} catch (error) {
await transaction.rollback();
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = {
"message": "登录失败"
}
}
}
async function varfiyCode(ctx) {
try {
const { models } = ctx.fs.dc;
const { pushBySms, pushByEmail } = ctx.app.fs.utils
const { phone, sig, r } = ctx.request.body
// 伪造的请求可能由相同的sig参数组成
const checkSigUsed = await models.PhoneValidateCode.findOne({
where: { sig: sig }
});
if (checkSigUsed) {
throw '参数错误!'
}
// 验证sig正确性
const checkSig = Hex.stringify(SHA1(phone + r));
if (!r || !sig || sig != checkSig) {
throw '参数错误!'
}
let varifyCode = ''
for (let i = 0; i < 6; i++) {
varifyCode += Math.floor(Math.random() * 10)
}
// await pushBySms({
// phone: phone,
// templateCode: 'SMS_248250074',
// templateParam: {
// code: varifyCode
// },
// })
await models.PhoneValidateCode.create({
phone: phone,
code: varifyCode,
sig: sig,
expired: moment().add(10, 'minutes').format('YYYY-MM-DD HH:mm:ss')
})
ctx.status = 204;
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = {
message: typeof error == 'string' ? error : '获取验证码失败'
}
}
async function varfiyCode (ctx) {
try {
const { models } = ctx.fs.dc;
const { pushBySms, pushByEmail } = ctx.app.fs.utils
const { phone, sig, r } = ctx.request.body
// 伪造的请求可能由相同的sig参数组成
const checkSigUsed = await models.PhoneValidateCode.findOne({
where: { sig: sig }
});
if (checkSigUsed) {
throw '参数错误!'
}
// 验证sig正确性
const checkSig = Hex.stringify(SHA1(phone + r));
if (!r || !sig || sig != checkSig) {
throw '参数错误!'
}
let varifyCode = ''
for (let i = 0; i < 6; i++) {
varifyCode += Math.floor(Math.random() * 10)
}
// await pushBySms({
// phone: phone,
// templateCode: 'SMS_248250074',
// templateParam: {
// code: varifyCode
// },
// })
await models.PhoneValidateCode.create({
phone: phone,
code: varifyCode,
sig: sig,
expired: moment().add(10, 'minutes').format('YYYY-MM-DD HH:mm:ss')
})
ctx.status = 204;
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = {
message: typeof error == 'string' ? error : '获取验证码失败'
}
}
}
async function logout(ctx) {
try {
const models = ctx.fs.dc.models;
const params = ctx.request.body;
async function logout (ctx) {
try {
const models = ctx.fs.dc.models;
const params = ctx.request.body;
await models.UserToken.destroy({
where: {
token: params.token,
}
});
ctx.status = 204;
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = {
message: typeof error == 'string' ? error : undefined
}
}
}
await models.UserToken.destroy({
where: {
token: params.token,
}
});
ctx.status = 204;
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = {
message: typeof error == 'string' ? error : undefined
}
}
async function screenlogin (ctx, next) {
let message = '登录失败'
const transaction = await ctx.fs.dc.orm.transaction();
try {
const models = ctx.fs.dc.models;
let { p, username, password } = ctx.request.body;
if (!p) {
message = '缺少pcode'
throw ''
}
let userRes = await models.ProjectUser.findOne({
where: { code: p },
}) || {}
if (!userRes.id) {
message = 'pcode不存在'
throw ''
}
if (userRes.del) {
message = '该项目已被删除,账户无法登录'
throw ''
}
let passwords = Hex.stringify(MD5(password));
if (username = !userRes.account || passwords != userRes.password) {
message = '账号或密码错误'
throw ''
}
let token = uuid.v4();
let userData = userRes.dataValues;
let userRslt = Object.assign({
projectName:userData.projectName,
projectType:userData.projectType,
projectDescribe:userData.projectDescribe,
monitorObject:userData.monitorObject,
id:userData.id,
del:userData.del,
createTime:userData.createTime,
account:userData.account,
}, {
authorized: true,
token: token,
});
await models.ProjectUserToken.create({
token: token,
projectUserInfo: userRslt,
expired: moment().add(30, 'days').format()
});
ctx.status = 200;
ctx.body = userRslt;
await transaction.commit();
} catch (error) {
await transaction.rollback();
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = {
"message": message
}
}
}
module.exports = {
login,
varfiyCode,
logout,
login,
varfiyCode,
logout,
screenlogin,
};

138
api/app/lib/controllers/projectManagement/projectPublish.js

@ -4,142 +4,8 @@ const { QueryTypes } = require('sequelize');
const Hex = require('crypto-js/enc-hex');
const MD5 = require('crypto-js/md5');
let axyTokenCache = {
token: null,
orgId: null,
expireTime: null, //过期时间
}
async function getAnxinyunToken (ctx) {
try {
if (!axyTokenCache.token || moment() > moment(axyTokenCache.expireTime)) {
if (ctx.app.fs.opts.axyProject.split('/').length === 3) {
const dataToAxy = {
domain: ctx.app.fs.opts.axyProject.split('/')[0],
username: ctx.app.fs.opts.axyProject.split('/')[1],
password: ctx.app.fs.opts.axyProject.split('/')[2],
}
const axyResponse = await ctx.app.fs.anxinyun.post('login', { data: dataToAxy })
if (axyResponse.authorized) {
axyTokenCache.token = axyResponse.token //放进缓存
axyTokenCache.orgId = axyResponse.orgId //放进缓存
axyTokenCache.expireTime = moment().add(1, 'hour').format('YYYY-MM-DD HH:mm:ss')
}
}
}
return axyTokenCache
} catch (error) {
ctx.fs.logger.error(`sechedule: laborAttendance, error: ${error}`)
}
}
//调用安心云结构物接口
async function findAnxinyunProject (ctx, next) {
try {
let { type, url, params = {} } = ctx.request.body
let data = await getAnxinyunToken(ctx)
if (url && url.indexOf('{orgId}') != -1) {
url = url.replace(`{orgId}`, data.orgId)
}
const res = await ctx.app.fs.anxinyun[type](`${url}?token=${data.token}`, {
data: params.data || {},
query: params.query || {},
})
ctx.status = 200
ctx.body = res
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`)
ctx.status = 400
ctx.body = {
message: '查询安心云项目失败',
}
}
}
async function addorEditRelation (ctx, next) {
let err = ''
const { axyProjectId, structrueId, id } = ctx.request.body
try {
const models = ctx.fs.dc.models
//编辑
if (id) {
const res = await models.ProjectBind.findOne({ where: { id, axyProjectId, structureId: structrueId } })
if (res) {
err = '所选安心云结构物和巡检结构物重复!!!'
throw '所选安心云结构物和巡检结构物重复!!!'
}
await models.ProjectBind.update({ axyProjectId, structureId: structrueId }, { where: { id } })
ctx.status = 204
ctx.body = {
message: '编辑成功!!',
}
} else {
//新增
const res = await models.ProjectBind.findOne({ where: { axyProjectId, structureId: structrueId } })
if (res) {
err = '所选安心云结构物和巡检结构物重复!!!'
throw '所选安心云结构物和巡检结构物重复!!!'
}
await models.ProjectBind.create({ axyProjectId, structureId: structrueId })
ctx.status = 204
ctx.body = {
message: '新增成功!!',
}
}
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`)
ctx.status = 400
ctx.body = {
message: err ? err : id ? '编辑失败' : '新增失败',
}
}
}
async function getRelationList (ctx, next) {
try {
const models = ctx.fs.dc.models
const { limit, page, startTime, endTime } = ctx.query
let options = {
where: {},
}
if (limit) {
options.limit = Number(limit)
}
if (page && limit) {
options.offset = Number(page) * Number(limit)
}
if (startTime && endTime) {
options.where.inspectTm = { $between: [startTime, endTime] }
}
const res = await models.ProjectBind.findAndCountAll(options)
ctx.body = res
ctx.status = 200
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`)
ctx.status = 400
ctx.body = {
message: '查询关联关系列表失败',
}
}
}
async function deleteRelation (ctx, next) {
const { id } = ctx.params
try {
const models = ctx.fs.dc.models
const res = await models.ProjectBind.findOne({ where: { id: Number(id) } })
if (!res) {
throw 'id不存在'
}
await models.ProjectBind.destroy({ where: { id: Number(id) } })
ctx.status = 200
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`)
ctx.status = 400
ctx.body = {
message: '关联关系列表失败',
}
}
}
async function getProjectType (ctx, next) {
try {
@ -227,10 +93,6 @@ async function delProjectPublish (ctx, next) {
}
module.exports = {
findAnxinyunProject,
addorEditRelation,
getRelationList,
deleteRelation,
getProjectType,
getProjectPublishList,
postProjectPublish,

2
api/app/lib/middlewares/authenticator.js

@ -59,6 +59,8 @@ let isPathExcluded = function (opts, path, method) {
let excludeOpts = opts.exclude || [];
excludeOpts.push({ p: '/login', o: 'POST' });
excludeOpts.push({ p: '/logout', o: 'PUT' });
excludeOpts.push({ p: '/screen/login', o: 'POST' });
excludeOpts.push({ p: '/screen/logout', o: 'PUT' });
excludeOpts.push({ p: '/patrolRecord/unlicensed', o: 'GET' });
excludes = new ExcludesUrls(excludeOpts);
}

4
api/app/lib/routes/auth/index.js

@ -11,4 +11,8 @@ module.exports = function (app, router, opts) {
app.fs.api.logAttr['PUT/logout'] = { content: '登出', visible: false };
router.put('/logout', auth.logout);
app.fs.api.logAttr['POST/screen/login'] = { content: '登录', visible: true };
router.post('/screen/login', auth.screenlogin);
};

12
web-screen/client/src/layout/components/sider/index.js

@ -25,11 +25,11 @@ const Sider = (props) => {
let selectedKeys = []
let openKeys = []
const lastSelectedKeys = localStorage.getItem('zhongding_selected_sider')
const lastSelectedKeys = localStorage.getItem('xunjian_selected_sider')
if (lastSelectedKeys) {
selectedKeys = JSON.parse(lastSelectedKeys)
}
const lastOpenKeys = localStorage.getItem('zhongding_open_sider')
const lastOpenKeys = localStorage.getItem('xunjian_open_sider')
if (lastOpenKeys) {
openKeys = JSON.parse(lastOpenKeys)
}
@ -49,9 +49,9 @@ const Sider = (props) => {
}
}
}
localStorage.setItem('zhongding_selected_sider', JSON.stringify(selectedKeys))
localStorage.setItem('xunjian_selected_sider', JSON.stringify(selectedKeys))
setSelectedKeys(selectedKeys)
localStorage.setItem('zhongding_open_sider', JSON.stringify(openKeys))
localStorage.setItem('xunjian_open_sider', JSON.stringify(openKeys))
setOpenKeys(openKeys)
}, [])
@ -64,11 +64,11 @@ const Sider = (props) => {
onSelect={(e) => {
const { selectedKeys } = e;
setSelectedKeys(selectedKeys)
localStorage.setItem('zhongding_selected_sider', JSON.stringify(selectedKeys))
localStorage.setItem('xunjian_selected_sider', JSON.stringify(selectedKeys))
}}
onOpenChange={(openKeys) => {
setOpenKeys(openKeys)
localStorage.setItem('zhongding_open_sider', JSON.stringify(openKeys))
localStorage.setItem('xunjian_open_sider', JSON.stringify(openKeys))
}}
>
{items}

86
web-screen/client/src/sections/auth/actions/auth.js

@ -1,62 +1,64 @@
'use strict';
import { message } from 'antd';
import { ApiTable } from '$utils'
import { Request } from '@peace/utils'
export const INIT_AUTH = 'INIT_AUTH';
export function initAuth () {
const user = JSON.parse(sessionStorage.getItem('user')) || {};
return {
type: INIT_AUTH,
payload: {
user: user
}
};
const user = JSON.parse(sessionStorage.getItem('user')) || {};
return {
type: INIT_AUTH,
payload: {
user: user
}
};
}
export const REQUEST_LOGIN = 'REQUEST_LOGIN';
export const LOGIN_SUCCESS = 'LOGIN_SUCCESS';
export const LOGIN_ERROR = 'LOGIN_ERROR';
export function login ({ username, password, phone, code }) {
return dispatch => {
dispatch({ type: REQUEST_LOGIN });
export function login ({ username, password, phone, code, p }) {
return dispatch => {
dispatch({ type: REQUEST_LOGIN });
return Request.post(ApiTable.login, { username, password, phone, code })
.then(user => {
sessionStorage.setItem('user', JSON.stringify(user));
dispatch({
type: LOGIN_SUCCESS,
payload: { user: user },
});
}, error => {
let { body } = error.response;
dispatch({
type: LOGIN_ERROR,
payload: {
error: body && body.message ? body.message : '登录失败'
}
})
return Request.post(ApiTable.login, { username, password, phone, code, p })
.then(user => {
sessionStorage.setItem('user', JSON.stringify(user));
dispatch({
type: LOGIN_SUCCESS,
payload: { user: user },
});
}
}, error => {
let { body } = error.response;
message.error(body && body.message ? body.message : '登录失败');
dispatch({
type: LOGIN_ERROR,
payload: {
error: body && body.message ? body.message : '登录失败'
}
})
});
}
}
export const LOGOUT = 'LOGOUT';
export const SCREEN_LOGOUT = 'SCREEN_LOGOUT';
export function logout (user) {
const token = user.token;
const url = ApiTable.logout;
sessionStorage.removeItem('user');
localStorage.removeItem('zhongding_selected_sider')
localStorage.removeItem('zhongding_open_sider')
Request.put(url, {
token: token
});
return {
type: LOGOUT
};
const token = user.token;
const url = ApiTable.logout;
sessionStorage.removeItem('user');
localStorage.removeItem('xunjian_selected_sider')
localStorage.removeItem('xunjian_open_sider')
Request.put(url, {
token: token
});
return {
type: SCREEN_LOGOUT
};
}
export default {
initAuth,
login,
logout
initAuth,
login,
logout
}

47
web-screen/client/src/sections/auth/containers/login.js

@ -7,18 +7,20 @@ import Hex from 'crypto-js/enc-hex';
import { ApiTable } from '$utils'
import { Request } from '@peace/utils'
import { Button, Input, Form, Row, Col, message, Tabs, Tooltip } from 'antd';
import { login, LOGIN_ERROR } from '../actions/auth';
import { login, SCREEN_LOGIN_ERROR } from '../actions/auth';
import { ExclamationCircleOutlined } from '@ant-design/icons';
import { Uploads } from '$components'
import { LockOutlined, UserOutlined } from '@ant-design/icons';
import { Func } from '$utils';
import qs from "qs";
import '../style.less';
const FormItem = Form.Item;
let codCountDownInterval = null
const Login = props => {
const { dispatch, user, error, isRequesting } = props
const { dispatch, user, error, isRequesting, location } = props
const [username, setUserName] = useState('')
const [password, setPassword] = useState('')
const [phone, setPhone] = useState('')
@ -33,39 +35,39 @@ const Login = props => {
const tourl = () => {
return '/shouye'
if (Func.isAuthorized("STRU_INFO_CONFIG")) {
return '/projectRegime/information'
return '/projectRegime/information'
}
if (Func.isAuthorized("QR_CODE_CONFIG")) {
return '/projectRegime/qrCode'
}
if (Func.isAuthorized("USER_CONFIG")) {
return '/organization/user'
return '/organization/user'
}
if (Func.isAuthorized("AUTH_CONFIG")) {
return '/organization/authority'
}
if (Func.isAuthorized("PATROL_PLAN_CONFIG")) {
return '/patrolManage/patrolPlan'
return '/patrolManage/patrolPlan'
}
if (Func.isAuthorized("PATROL_RECORD_VIEW")) {
return '/patrolManage/patrolRecord'
}
if (Func.isAuthorized("CHECKREPORT")) {
return '/patrolManage/patrolReport'
}
if (Func.isAuthorized("CHECKITEMSET")) {
return '/patrolManage/checkItems'
}
if (Func.isAuthorized("CHECKMOULD")) {
return '/patrolManage/patrolTemplate'
}
if (Func.isAuthorized("WENTICHULI")) {
return '/issueHandle'
}
}
if (Func.isAuthorized("CHECKREPORT")) {
return '/patrolManage/patrolReport'
}
if (Func.isAuthorized("CHECKITEMSET")) {
return '/patrolManage/checkItems'
}
if (Func.isAuthorized("CHECKMOULD")) {
return '/patrolManage/patrolTemplate'
}
if (Func.isAuthorized("WENTICHULI")) {
return '/issueHandle'
}
else {
return message.warn('没有任何模块的查看权限')
return message.warn('没有任何模块的查看权限')
}
}
}
useEffect(() => {
@ -136,11 +138,11 @@ if (Func.isAuthorized("WENTICHULI")) {
form={form}
onFinish={r => {
form.validateFields().then(r => {
dispatch(login({ username: r.username, password: r.password }));
dispatch(login({ username: r.username, password: r.password, p: qs.parse(location?.search?.slice(1))?.p }))
})
.catch(err => {
dispatch({
type: LOGIN_ERROR,
type: SCREEN_LOGIN_ERROR,
payload: { error: '请输入账号名和密码' }
})
})
@ -177,7 +179,6 @@ if (Func.isAuthorized("WENTICHULI")) {
function mapStateToProps (state) {
const { auth } = state;
console.log(auth.error);
return {
user: auth.user,
error: auth.error,

2
web-screen/client/src/sections/auth/reducers/auth.js

@ -28,7 +28,7 @@ function auth(state = initState, action) {
isRequesting: false,
error: payload.error
}).toJS();
case actionTypes.LOGOUT:
case actionTypes.SCREEN_LOGOUT:
return Immutable.fromJS(state).merge({
user: null
}).toJS();

4
web-screen/client/src/utils/webapi.js

@ -2,8 +2,8 @@
import request from 'superagent';
export const ApiTable = {
login: 'login',
logout: 'logout',
login: 'screen/login',
logout: 'screen/logout',
validatePhone: 'validate/phone',
getUserSiteList: 'user/site/list',

12
web/client/src/layout/components/sider/index.js

@ -25,11 +25,11 @@ const Sider = (props) => {
let selectedKeys = []
let openKeys = []
const lastSelectedKeys = localStorage.getItem('zhongding_selected_sider')
const lastSelectedKeys = localStorage.getItem('xunjian_selected_sider')
if (lastSelectedKeys) {
selectedKeys = JSON.parse(lastSelectedKeys)
}
const lastOpenKeys = localStorage.getItem('zhongding_open_sider')
const lastOpenKeys = localStorage.getItem('xunjian_open_sider')
if (lastOpenKeys) {
openKeys = JSON.parse(lastOpenKeys)
}
@ -49,9 +49,9 @@ const Sider = (props) => {
}
}
}
localStorage.setItem('zhongding_selected_sider', JSON.stringify(selectedKeys))
localStorage.setItem('xunjian_selected_sider', JSON.stringify(selectedKeys))
setSelectedKeys(selectedKeys)
localStorage.setItem('zhongding_open_sider', JSON.stringify(openKeys))
localStorage.setItem('xunjian_open_sider', JSON.stringify(openKeys))
setOpenKeys(openKeys)
}, [])
@ -64,11 +64,11 @@ const Sider = (props) => {
onSelect={(e) => {
const { selectedKeys } = e;
setSelectedKeys(selectedKeys)
localStorage.setItem('zhongding_selected_sider', JSON.stringify(selectedKeys))
localStorage.setItem('xunjian_selected_sider', JSON.stringify(selectedKeys))
}}
onOpenChange={(openKeys) => {
setOpenKeys(openKeys)
localStorage.setItem('zhongding_open_sider', JSON.stringify(openKeys))
localStorage.setItem('xunjian_open_sider', JSON.stringify(openKeys))
}}
>
{items}

4
web/client/src/sections/auth/actions/auth.js

@ -45,8 +45,8 @@ export function logout (user) {
const token = user.token;
const url = ApiTable.logout;
sessionStorage.removeItem('user');
localStorage.removeItem('zhongding_selected_sider')
localStorage.removeItem('zhongding_open_sider')
localStorage.removeItem('xunjian_selected_sider')
localStorage.removeItem('xunjian_open_sider')
Request.put(url, {
token: token
});

13
web/client/src/sections/projectManagement/actions/projectPublish.js

@ -38,19 +38,6 @@ export function postProjectPublish (data = {}) {
}
// export function addorEditRelation(data) {
// return dispatch => basicAction({
// type: 'post',
// dispatch: dispatch,
// data,
// actionType: 'ADD_OR_EDIT_RELATION',
// url: `${ApiTable.addorEditRelation}`,
// msg: { option:data?.id? '编辑绑定关系':'新增绑定关系' },
// // reducer: { name: 'anxinyunProject'}
// });
// }
export function delProjectPublish (id) {
return dispatch => basicAction({

2
web/client/src/sections/projectManagement/containers/projectPublish.js

@ -181,7 +181,7 @@ const ProjectPublish = ({ dispatch, actions, user, loading, publishList, webScre
>
<Input
disabled={true}
addonBefore={webScreen + '?p='}
addonBefore={webScreen + '/signin?p='}
addonAfter={<div style={{ cursor: 'pointer' }} onClick={() => { setCode(v4()) }}><SettingOutlined />修改</div>}
value={code} />
</Modal>

Loading…
Cancel
Save