|
@@ -1,5 +1,7 @@
|
|
|
package com.ruoyi.web.controller.system;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.ruoyi.common.annotation.Log;
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
@@ -130,6 +132,17 @@ public class UserRelateController extends BaseController
|
|
|
properties.load(inputStream);
|
|
|
String urlRules = properties.getProperty("user_ralte_url_rules[" + userRelate.getDanganId() + "]");
|
|
|
if(!StringUtils.isEmpty(urlRules)){
|
|
|
+ if(!StringUtils.isEmpty(userRelate.getDanganLoginName())) {
|
|
|
+ JSONArray jsonArray = JSONArray.parseArray(urlRules);
|
|
|
+ JSONObject jsonObject = jsonArray.getJSONObject(0);
|
|
|
+ if("username".equals(jsonObject.getString("key"))) {
|
|
|
+ jsonObject.put("value", userRelate.getDanganLoginName());
|
|
|
+
|
|
|
+ JSONArray newJsonArray = new JSONArray();
|
|
|
+ newJsonArray.add(jsonObject);
|
|
|
+ urlRules = newJsonArray.toJSONString();
|
|
|
+ }
|
|
|
+ }
|
|
|
userRelate.setUrlRules(urlRules);
|
|
|
}
|
|
|
}catch(Exception e){
|
|
@@ -189,6 +202,17 @@ public class UserRelateController extends BaseController
|
|
|
userRelate.setRelateTime(new Date());
|
|
|
String urlRules = properties.getProperty("user_ralte_url_rules[" + userRelate.getDanganId() + "]");
|
|
|
if(!StringUtils.isEmpty(urlRules)){
|
|
|
+ if(!StringUtils.isEmpty(userRelate.getDanganLoginName())) {
|
|
|
+ JSONArray jsonArray= JSONArray.parseArray(urlRules);
|
|
|
+ JSONObject jsonObject = jsonArray.getJSONObject(0);
|
|
|
+ if("username".equals(jsonObject.getString("key"))) {
|
|
|
+ jsonObject.put("value", userRelate.getDanganLoginName());
|
|
|
+
|
|
|
+ JSONArray newJsonArray = new JSONArray();
|
|
|
+ newJsonArray.add(jsonObject);
|
|
|
+ urlRules = newJsonArray.toJSONString();
|
|
|
+ }
|
|
|
+ }
|
|
|
userRelate.setUrlRules(urlRules);
|
|
|
}
|
|
|
userRelate.setCreateBy(ShiroUtils.getLoginName());
|