HeadController.java 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543
  1. package com.zhcs.dt.controller.system.head;
  2. import java.util.ArrayList;
  3. import java.util.HashMap;
  4. import java.util.List;
  5. import java.util.Map;
  6. import javax.annotation.Resource;
  7. import org.apache.shiro.session.Session;
  8. import org.springframework.stereotype.Controller;
  9. import org.springframework.web.bind.annotation.RequestMapping;
  10. import org.springframework.web.bind.annotation.ResponseBody;
  11. import org.springframework.web.servlet.ModelAndView;
  12. import com.zhcs.dt.controller.base.BaseController;
  13. import com.zhcs.dt.entity.system.Role;
  14. import com.zhcs.dt.service.system.appuser.AppuserManager;
  15. //import com.zhcs.dt.service.system.fhsms.FhsmsManager;
  16. import com.zhcs.dt.service.system.role.RoleManager;
  17. import com.zhcs.dt.service.system.user.UserManager;
  18. import com.zhcs.dt.service.system.userphoto.UserPhotoManager;
  19. import com.zhcs.dt.util.AppUtil;
  20. import com.zhcs.dt.util.Const;
  21. import com.zhcs.dt.util.Jurisdiction;
  22. import com.zhcs.dt.util.PageData;
  23. import com.zhcs.dt.util.SmsUtil;
  24. import com.zhcs.dt.util.Tools;
  25. import com.zhcs.dt.util.Watermark;
  26. //import com.zhcs.dt.util.mail.SimpleMailSender;
  27. /**
  28. * 类名称:HeadController
  29. * 创建人:FH 313596790Q
  30. * 修改时间:2018年2月4日
  31. * @version
  32. */
  33. @Controller
  34. @RequestMapping(value="/head")
  35. public class HeadController extends BaseController {
  36. @Resource(name="userService")
  37. private UserManager userService;
  38. @Resource(name="appuserService")
  39. private AppuserManager appuserService;
  40. // @Resource(name="fhsmsService")
  41. // private FhsmsManager fhsmsService;
  42. @Resource(name="userphotoService")
  43. private UserPhotoManager userphotoService;
  44. @Resource(name="roleService")
  45. private RoleManager roleService;
  46. /**去编辑头像页面
  47. * @return
  48. * @throws Exception
  49. */
  50. @RequestMapping(value="/editPhoto")
  51. public ModelAndView editPhoto() throws Exception{
  52. ModelAndView mv = this.getModelAndView();
  53. PageData pd = new PageData();
  54. pd = this.getPageData();
  55. mv.setViewName("system/userphoto/userphoto_edit");
  56. mv.addObject("pd", pd);
  57. return mv;
  58. }
  59. /**获取基本信息
  60. * @return
  61. */
  62. @RequestMapping(value="/getList")
  63. @ResponseBody
  64. public Object getList() {
  65. PageData pd = new PageData();
  66. Map<String,Object> map = new HashMap<String,Object>();
  67. try {
  68. pd = this.getPageData();
  69. List<PageData> pdList = new ArrayList<PageData>();
  70. Session session = Jurisdiction.getSession();
  71. PageData pds = new PageData();
  72. pds = (PageData)session.getAttribute(Const.SESSION_userpds);
  73. if(null == pds){
  74. pd.put(Const.SESSION_USERNAME, Jurisdiction.getUsername());//当前登录者用户名
  75. pds = userService.findByUsername(pd);
  76. session.setAttribute(Const.SESSION_userpds, pds);
  77. }
  78. pdList.add(pds);
  79. map.put("list", pdList);
  80. PageData pdPhoto = userphotoService.findById(pds);
  81. map.put("userPhoto", null == pdPhoto?"static/ace/avatars/user.jpg":pdPhoto.getString("PHOTO2"));//用户头像
  82. // map.put("fhsmsCount", fhsmsService.findFhsmsCount(Jurisdiction.getUsername()).get("fhsmsCount").toString());//站内信未读总数
  83. String strWEBSOCKET = Tools.readTxtFile(Const.WEBSOCKET);//读取WEBSOCKET配置
  84. if(null != strWEBSOCKET && !"".equals(strWEBSOCKET)){
  85. String strIW[] = strWEBSOCKET.split(",fh,");
  86. if(strIW.length == 7){
  87. map.put("wimadress", strIW[0]+":"+strIW[1]); //即时聊天服务器IP和端口
  88. map.put("oladress", strIW[2]+":"+strIW[3]); //在线管理和站内信服务器IP和端口
  89. map.put("FHsmsSound", strIW[4]); //站内信提示音效配置
  90. }
  91. }
  92. Object RNUMBERS = session.getAttribute(Const.SESSION_RNUMBERS);
  93. if(null == RNUMBERS){
  94. session.setAttribute(Const.SESSION_RNUMBERS, getRnumbers()); //把当前用户的角色编码放入session
  95. }
  96. } catch (Exception e) {
  97. logger.error(e.toString(), e);
  98. } finally {
  99. logAfter(logger);
  100. }
  101. return AppUtil.returnObject(pd, map);
  102. }
  103. /**判断当前用户角色编码符合过滤条件(用于新任务消息通知)
  104. * @return
  105. * @throws Exception
  106. */
  107. @RequestMapping(value="/isNowRole")
  108. @ResponseBody
  109. public Object isNowRole() throws Exception{
  110. PageData pd = new PageData();
  111. pd = this.getPageData();
  112. Map<String,Object> map = new HashMap<String,Object>();
  113. if(Jurisdiction.getRnumbers().indexOf(pd.getString("RNUMBER"))!=-1){
  114. map.put("msg", "yes");
  115. }else{
  116. map.put("msg", "no");
  117. }
  118. return AppUtil.returnObject(pd, map);
  119. }
  120. /**通过角色ID数组获取角色列表拼接角色编码
  121. * @return
  122. * @throws Exception
  123. */
  124. public String getRnumbers() throws Exception{
  125. PageData userpd = new PageData();
  126. userpd.put(Const.SESSION_USERNAME, Jurisdiction.getUsername());
  127. userpd = userService.findByUsername(userpd); //通过用户名获取用户信息
  128. String ZROLE_ID = userpd.get("ROLE_ID").toString()+",fh,"+userpd.getString("ROLE_IDS");
  129. String arryROLE_ID[] = ZROLE_ID.split(",fh,");
  130. List<Role> rlist = roleService.getRoleByArryROLE_ID(arryROLE_ID);
  131. StringBuffer RNUMBERS = new StringBuffer();
  132. RNUMBERS.append("(");
  133. for(Role role:rlist){
  134. RNUMBERS.append("'"+role.getRNUMBER()+"'");
  135. }
  136. RNUMBERS.append(")");
  137. return RNUMBERS.toString();
  138. }
  139. /**保存用户皮肤
  140. * @return
  141. * @throws Exception
  142. */
  143. @RequestMapping(value="/saveSkin")
  144. @ResponseBody
  145. public Object saveSkin() throws Exception{
  146. PageData pd = new PageData();
  147. pd = this.getPageData();
  148. pd.put(Const.SESSION_USERNAME, Jurisdiction.getUsername());//当前登录者用户名
  149. userService.saveSkin(pd);
  150. Session session = Jurisdiction.getSession();
  151. session.setAttribute(Const.SKIN, pd.getString("SKIN"));
  152. Map<String,Object> map = new HashMap<String,Object>();
  153. map.put("pd", pd);
  154. return AppUtil.returnObject(pd, map);
  155. }
  156. /* *//**获取站内信未读总数
  157. * @return
  158. *//*
  159. @RequestMapping(value="/getFhsmsCount")
  160. @ResponseBody
  161. public Object getFhsmsCount() {
  162. PageData pd = new PageData();
  163. Map<String,Object> map = new HashMap<String,Object>();
  164. try {
  165. map.put("fhsmsCount", fhsmsService.findFhsmsCount(Jurisdiction.getUsername()).get("fhsmsCount").toString());//站内信未读总数
  166. } catch (Exception e) {
  167. logger.error(e.toString(), e);
  168. } finally {
  169. logAfter(logger);
  170. }
  171. return AppUtil.returnObject(pd, map);
  172. }*/
  173. /**去发送邮箱页面
  174. * @return
  175. * @throws Exception
  176. */
  177. @RequestMapping(value="/editEmail")
  178. public ModelAndView editEmail() throws Exception{
  179. ModelAndView mv = this.getModelAndView();
  180. PageData pd = new PageData();
  181. pd = this.getPageData();
  182. mv.setViewName("system/head/edit_email");
  183. mv.addObject("pd", pd);
  184. return mv;
  185. }
  186. /**去发送短信页面
  187. * @return
  188. * @throws Exception
  189. */
  190. @RequestMapping(value="/goSendSms")
  191. public ModelAndView goSendSms() throws Exception{
  192. ModelAndView mv = this.getModelAndView();
  193. PageData pd = new PageData();
  194. pd = this.getPageData();
  195. mv.setViewName("system/head/send_sms");
  196. mv.addObject("pd", pd);
  197. return mv;
  198. }
  199. /**发送短信
  200. * @return
  201. */
  202. @RequestMapping(value="/sendSms")
  203. @ResponseBody
  204. public Object sendSms(){
  205. PageData pd = new PageData();
  206. pd = this.getPageData();
  207. Map<String,Object> map = new HashMap<String,Object>();
  208. String msg = "ok"; //发送状态
  209. int count = 0; //统计发送成功条数
  210. int zcount = 0; //理论条数
  211. List<PageData> pdList = new ArrayList<PageData>();
  212. String PHONEs = pd.getString("PHONE"); //对方邮箱
  213. String CONTENT = pd.getString("CONTENT"); //内容
  214. String isAll = pd.getString("isAll"); //是否发送给全体成员 yes or no
  215. String TYPE = pd.getString("TYPE"); //类型 1:短信接口1 2:短信接口2
  216. String fmsg = pd.getString("fmsg"); //判断是系统用户还是会员 "appuser"为会员用户
  217. if("yes".endsWith(isAll)){
  218. try {
  219. List<PageData> userList = new ArrayList<PageData>();
  220. userList = "appuser".equals(fmsg) ? appuserService.listAllUser(pd):userService.listAllUser(pd);
  221. zcount = userList.size();
  222. try {
  223. for(int i=0;i<userList.size();i++){
  224. if(Tools.checkMobileNumber(userList.get(i).getString("PHONE"))){ //手机号格式不对就跳过
  225. if("1".equals(TYPE)){
  226. SmsUtil.sendSms1(userList.get(i).getString("PHONE"), CONTENT); //调用发短信函数1
  227. }else{
  228. SmsUtil.sendSms2(userList.get(i).getString("PHONE"), CONTENT); //调用发短信函数2
  229. }
  230. count++;
  231. }else{
  232. continue;
  233. }
  234. }
  235. msg = "ok";
  236. } catch (Exception e) {
  237. msg = "error";
  238. }
  239. } catch (Exception e) {
  240. msg = "error";
  241. }
  242. }else{
  243. PHONEs = PHONEs.replaceAll(";", ";");
  244. PHONEs = PHONEs.replaceAll(" ", "");
  245. String[] arrTITLE = PHONEs.split(";");
  246. zcount = arrTITLE.length;
  247. try {
  248. for(int i=0;i<arrTITLE.length;i++){
  249. if(Tools.checkMobileNumber(arrTITLE[i])){ //手机号式不对就跳过
  250. if("1".equals(TYPE)){
  251. SmsUtil.sendSms1(arrTITLE[i], CONTENT); //调用发短信函数1
  252. }else{
  253. SmsUtil.sendSms2(arrTITLE[i], CONTENT); //调用发短信函数2
  254. }
  255. count++;
  256. }else{
  257. continue;
  258. }
  259. }
  260. msg = "ok";
  261. } catch (Exception e) {
  262. msg = "error";
  263. }
  264. }
  265. pd.put("msg", msg);
  266. pd.put("count", count); //成功数
  267. pd.put("ecount", zcount-count); //失败数
  268. pdList.add(pd);
  269. map.put("list", pdList);
  270. return AppUtil.returnObject(pd, map);
  271. }
  272. /**去发送电子邮件页面
  273. * @return
  274. * @throws Exception
  275. */
  276. @RequestMapping(value="/goSendEmail")
  277. public ModelAndView goSendEmail() throws Exception{
  278. ModelAndView mv = this.getModelAndView();
  279. PageData pd = new PageData();
  280. pd = this.getPageData();
  281. mv.setViewName("system/head/send_email");
  282. mv.addObject("pd", pd);
  283. return mv;
  284. }
  285. /**发送电子邮件
  286. * @return
  287. */
  288. /*@RequestMapping(value="/sendEmail")
  289. @ResponseBody
  290. public Object sendEmail(){
  291. PageData pd = new PageData();
  292. pd = this.getPageData();
  293. Map<String,Object> map = new HashMap<String,Object>();
  294. String msg = "ok"; //发送状态
  295. int count = 0; //统计发送成功条数
  296. int zcount = 0; //理论条数
  297. String strEMAIL = Tools.readTxtFile(Const.EMAIL); //读取邮件配置
  298. List<PageData> pdList = new ArrayList<PageData>();
  299. String toEMAIL = pd.getString("EMAIL"); //对方邮箱
  300. String TITLE = pd.getString("TITLE"); //标题
  301. String CONTENT = pd.getString("CONTENT"); //内容
  302. String TYPE = pd.getString("TYPE"); //类型
  303. String isAll = pd.getString("isAll"); //是否发送给全体成员 yes or no
  304. String fmsg = pd.getString("fmsg"); //判断是系统用户还是会员 "appuser"为会员用户
  305. if(null != strEMAIL && !"".equals(strEMAIL)){
  306. String strEM[] = strEMAIL.split(",fh,");
  307. if(strEM.length == 4){
  308. if("yes".endsWith(isAll)){
  309. try {
  310. List<PageData> userList = new ArrayList<PageData>();
  311. userList = "appuser".equals(fmsg) ? appuserService.listAllUser(pd):userService.listAllUser(pd);
  312. zcount = userList.size();
  313. try {
  314. for(int i=0;i<userList.size();i++){
  315. if(Tools.checkEmail(userList.get(i).getString("EMAIL"))){ //邮箱格式不对就跳过
  316. SimpleMailSender.sendEmail(strEM[0], strEM[1], strEM[2], strEM[3], userList.get(i).getString("EMAIL"), TITLE, CONTENT, TYPE);//调用发送邮件函数
  317. count++;
  318. }else{
  319. continue;
  320. }
  321. }
  322. msg = "ok";
  323. } catch (Exception e) {
  324. msg = "error";
  325. }
  326. } catch (Exception e) {
  327. msg = "error";
  328. }
  329. }else{
  330. toEMAIL = toEMAIL.replaceAll(";", ";");
  331. toEMAIL = toEMAIL.replaceAll(" ", "");
  332. String[] arrTITLE = toEMAIL.split(";");
  333. zcount = arrTITLE.length;
  334. try {
  335. for(int i=0;i<arrTITLE.length;i++){
  336. if(Tools.checkEmail(arrTITLE[i])){ //邮箱格式不对就跳过
  337. SimpleMailSender.sendEmail(strEM[0], strEM[1], strEM[2], strEM[3], arrTITLE[i], TITLE, CONTENT, TYPE);//调用发送邮件函数
  338. count++;
  339. }else{
  340. continue;
  341. }
  342. }
  343. msg = "ok";
  344. } catch (Exception e) {
  345. msg = "error";
  346. }
  347. }
  348. }else{
  349. msg = "error";
  350. }
  351. }else{
  352. msg = "error";
  353. }
  354. pd.put("msg", msg);
  355. pd.put("count", count); //成功数
  356. pd.put("ecount", zcount-count); //失败数
  357. pdList.add(pd);
  358. map.put("list", pdList);
  359. return AppUtil.returnObject(pd, map);
  360. }*/
  361. /**去系统设置页面
  362. * @return
  363. * @throws Exception
  364. */
  365. @RequestMapping(value="/goSystem")
  366. public ModelAndView goEditEmail() throws Exception{
  367. if(!"admin".equals(Jurisdiction.getUsername())){return null;} //非admin用户不能修改
  368. ModelAndView mv = this.getModelAndView();
  369. PageData pd = new PageData();
  370. pd = this.getPageData();
  371. pd.put("YSYNAME", Tools.readTxtFile(Const.SYSNAME)); //读取系统名称
  372. pd.put("COUNTPAGE", Tools.readTxtFile(Const.PAGE)); //读取每页条数
  373. String strEMAIL = Tools.readTxtFile(Const.EMAIL); //读取邮件配置
  374. String strSMS1 = Tools.readTxtFile(Const.SMS1); //读取短信1配置
  375. String strSMS2 = Tools.readTxtFile(Const.SMS2); //读取短信2配置
  376. String strFWATERM = Tools.readTxtFile(Const.FWATERM); //读取文字水印配置
  377. String strIWATERM = Tools.readTxtFile(Const.IWATERM); //读取图片水印配置
  378. pd.put("Token", Tools.readTxtFile(Const.WEIXIN)); //读取微信配置
  379. String strWEBSOCKET = Tools.readTxtFile(Const.WEBSOCKET);//读取WEBSOCKET配置
  380. String strLOGINEDIT = Tools.readTxtFile(Const.LOGINEDIT);//读取登录页面配置
  381. if(null != strEMAIL && !"".equals(strEMAIL)){
  382. String strEM[] = strEMAIL.split(",fh,");
  383. if(strEM.length == 4){
  384. pd.put("SMTP", strEM[0]);
  385. pd.put("PORT", strEM[1]);
  386. pd.put("EMAIL", strEM[2]);
  387. pd.put("PAW", strEM[3]);
  388. }
  389. }
  390. if(null != strSMS1 && !"".equals(strSMS1)){
  391. String strS1[] = strSMS1.split(",fh,");
  392. if(strS1.length == 2){
  393. pd.put("SMSU1", strS1[0]);
  394. pd.put("SMSPAW1", strS1[1]);
  395. }
  396. }
  397. if(null != strSMS2 && !"".equals(strSMS2)){
  398. String strS2[] = strSMS2.split(",fh,");
  399. if(strS2.length == 2){
  400. pd.put("SMSU2", strS2[0]);
  401. pd.put("SMSPAW2", strS2[1]);
  402. }
  403. }
  404. if(null != strFWATERM && !"".equals(strFWATERM)){
  405. String strFW[] = strFWATERM.split(",fh,");
  406. if(strFW.length == 5){
  407. pd.put("isCheck1", strFW[0]);
  408. pd.put("fcontent", strFW[1]);
  409. pd.put("fontSize", strFW[2]);
  410. pd.put("fontX", strFW[3]);
  411. pd.put("fontY", strFW[4]);
  412. }
  413. }
  414. if(null != strIWATERM && !"".equals(strIWATERM)){
  415. String strIW[] = strIWATERM.split(",fh,");
  416. if(strIW.length == 4){
  417. pd.put("isCheck2", strIW[0]);
  418. pd.put("imgUrl", strIW[1]);
  419. pd.put("imgX", strIW[2]);
  420. pd.put("imgY", strIW[3]);
  421. }
  422. }
  423. if(null != strWEBSOCKET && !"".equals(strWEBSOCKET)){
  424. String strIW[] = strWEBSOCKET.split(",fh,");
  425. if(strIW.length == 7){
  426. pd.put("WIMIP", strIW[0]);
  427. pd.put("WIMPORT", strIW[1]);
  428. pd.put("OLIP", strIW[2]);
  429. pd.put("OLPORT", strIW[3]);
  430. pd.put("FHsmsSound", strIW[4]);
  431. pd.put("VIDEOIP", strIW[5]);
  432. pd.put("VIDEOPORT", strIW[6]);
  433. }
  434. }
  435. if(null != strLOGINEDIT && !"".equals(strLOGINEDIT)){
  436. String strLo[] = strLOGINEDIT.split(",fh,");
  437. if(strLo.length == 2){
  438. pd.put("isZhuce", strLo[0]);
  439. pd.put("isMusic", strLo[1]);
  440. }
  441. }
  442. mv.setViewName("system/head/sys_edit");
  443. mv.addObject("pd", pd);
  444. return mv;
  445. }
  446. /**保存系统设置1
  447. * @return
  448. * @throws Exception
  449. */
  450. @RequestMapping(value="/saveSys")
  451. public ModelAndView saveSys() throws Exception{
  452. if(!"admin".equals(Jurisdiction.getUsername())){return null;} //非admin用户不能修改
  453. ModelAndView mv = this.getModelAndView();
  454. PageData pd = new PageData();
  455. pd = this.getPageData();
  456. Tools.writeFile(Const.SYSNAME,pd.getString("YSYNAME")); //写入系统名称
  457. Tools.writeFile(Const.PAGE,pd.getString("COUNTPAGE")); //写入每页条数
  458. Tools.writeFile(Const.EMAIL,pd.getString("SMTP")+",fh,"+pd.getString("PORT")+",fh,"+pd.getString("EMAIL")+",fh,"+pd.getString("PAW")); //写入邮件服务器配置
  459. Tools.writeFile(Const.SMS1,pd.getString("SMSU1")+",fh,"+pd.getString("SMSPAW1")); //写入短信1配置
  460. Tools.writeFile(Const.SMS2,pd.getString("SMSU2")+",fh,"+pd.getString("SMSPAW2")); //写入短信2配置
  461. mv.addObject("msg","OK");
  462. mv.setViewName("save_result");
  463. return mv;
  464. }
  465. /**保存系统设置2
  466. * @return
  467. * @throws Exception
  468. */
  469. @RequestMapping(value="/saveSys2")
  470. public ModelAndView saveSys2() throws Exception{
  471. if(!"admin".equals(Jurisdiction.getUsername())){return null;} //非admin用户不能修改
  472. ModelAndView mv = this.getModelAndView();
  473. PageData pd = new PageData();
  474. pd = this.getPageData();
  475. Tools.writeFile(Const.FWATERM,pd.getString("isCheck1")+",fh,"+pd.getString("fcontent")+",fh,"+pd.getString("fontSize")+",fh,"+pd.getString("fontX")+",fh,"+pd.getString("fontY")); //文字水印配置
  476. Tools.writeFile(Const.IWATERM,pd.getString("isCheck2")+",fh,"+pd.getString("imgUrl")+",fh,"+pd.getString("imgX")+",fh,"+pd.getString("imgY")); //图片水印配置
  477. Watermark.fushValue();
  478. mv.addObject("msg","OK");
  479. mv.setViewName("save_result");
  480. return mv;
  481. }
  482. /**保存系统设置3
  483. * @return
  484. * @throws Exception
  485. */
  486. @RequestMapping(value="/saveSys3")
  487. public ModelAndView saveSys3() throws Exception{
  488. if(!"admin".equals(Jurisdiction.getUsername())){return null;} //非admin用户不能修改
  489. ModelAndView mv = this.getModelAndView();
  490. PageData pd = new PageData();
  491. pd = this.getPageData();
  492. String winStr = pd.getString("WIMIP")+",fh,"+pd.getString("WIMPORT")+",fh,"; //即时通讯配置
  493. String olStr = pd.getString("OLIP")+",fh,"+pd.getString("OLPORT")+",fh,"+pd.getString("FHsmsSound")+",fh,"; //站内信配置
  494. String videoStr = pd.getString("VIDEOIP")+",fh,"+pd.getString("VIDEOPORT"); //视频弹幕配置
  495. Tools.writeFile(Const.WEBSOCKET,winStr+olStr+videoStr); //websocket配置
  496. mv.addObject("msg","OK");
  497. mv.setViewName("save_result");
  498. return mv;
  499. }
  500. /**保存系统设置4
  501. * @return
  502. * @throws Exception
  503. */
  504. @RequestMapping(value="/saveSys4")
  505. public ModelAndView saveSys4() throws Exception{
  506. if(!"admin".equals(Jurisdiction.getUsername())){return null;} //非admin用户不能修改
  507. ModelAndView mv = this.getModelAndView();
  508. PageData pd = new PageData();
  509. pd = this.getPageData();
  510. Tools.writeFile(Const.WEIXIN,pd.getString("Token")); //写入微信配置
  511. Tools.writeFile(Const.LOGINEDIT,pd.getString("isZhuce")+",fh,"+pd.getString("isMusic")); //登录页面配置
  512. mv.addObject("msg","OK");
  513. mv.setViewName("save_result");
  514. return mv;
  515. }
  516. }
  517. // F-H Q 3-135-9679-0