import { layuiObj } from "../index.js"; import { stationurl } from "../../../../public/js/url.js"; function updateSystemName(systemName){ layuiObj["layer"].open({ type:1, title:"系统信息", //不显示标题栏 area:['500px', '160px'], id:new Date().getTime(), //设定一个id,防止重复弹出 resize:false, content:`
` }) //修改系统名称 $("#systemNameUpdateBtn").click(function(){ var systemName=$(".systemNameTitle").val(); updateSystemReq(systemName); }) } function updateSystemReq(systemName){ var unameInfo=JSON.parse(sessionStorage.getItem("unameInfoStr"));//获取用户登录信息 var updateSystemUrl=stationurl+"/common/client/user/update"; var updateInfo={ "name":unameInfo['user_name'], "theme":JSON.stringify({ "title":systemName }) } axios({ method:'post', url:updateSystemUrl, data: updateInfo }).then(res=>{ var code=res["data"]["code"]; if(code==0){ layuiObj.layer.confirm('系统名称修改成功,请重新登录', { btn: ['确定'], cancel:function(index, layero){ window.location.href = "../../login.html"; } }, function(index, layero) { window.location.href = "../../login.html"; }); }else{ layuiObj.layer.msg("修改失败") } }) } export {updateSystemName}