kgdxpr 1 year ago
commit 24d82f8362

@ -7,6 +7,7 @@ import com.dsideal.QingLong.DataShare.Model.DataShareModel;
import com.dsideal.QingLong.Interceptor.*;
import com.dsideal.QingLong.Util.AsposeUtil;
import com.dsideal.QingLong.Util.CommonUtil;
import com.dsideal.QingLong.Util.PgUtil;
import com.jfinal.aop.Before;
import com.jfinal.core.Controller;
import com.jfinal.ext.interceptor.GET;
@ -171,7 +172,7 @@ public class DataShareController extends Controller {
String file_name = array[array.length - 1];
String basePath = PathKit.getWebRootPath() + "/upload/";
String realPath = basePath + file_name;
realPath=realPath.replace("\\","/");
realPath = realPath.replace("\\", "/");
String system_name = record.getStr("system_name");
//注册信息
AsposeUtil.getLicense();
@ -269,6 +270,23 @@ public class DataShareController extends Controller {
renderJson(kv);
}
/**
*
*
* @param system_id
*/
@Before({POST.class})
@IsLoginInterface({})
@IsSysAdminInterface({"1"})
@IsNumericInterface({"system_id"})
public void changePwd(int system_id) {
String user_name = dm.getSystemById(system_id).getStr("user_name");
String pwd = CommonUtil.generatePassword(10);
PgUtil.changePwd(user_name, pwd);
Kv kv = Kv.by("success", true);
kv.set("message", "修改成功!");
renderJson(kv);
}
/**
*

@ -104,11 +104,23 @@ public class PgUtil {
return sum > 0;
}
/**
*
*
* @param user_name
* @param pwd
*/
public static void changePwd(String user_name, String pwd) {
String sql = "ALTER USER " + user_name + " WITH PASSWORD '" + pwd + "'";
Db.update(sql);
}
//写权限
public static String WRITE = "INSERT,UPDATE,DELETE,SELECT";
//读权限
public static String READ = "SELECT";
/**
*
* vi /usr/local/postgresql/data/pg_hba.conf
@ -150,4 +162,6 @@ public class PgUtil {
System.out.println(record);
}
}
}

Loading…
Cancel
Save