按照用户名和角色查询用户liferay
需求:当登录的用户输入用户的名字和角色的时候,模糊查询,然后就是Ajax的异步请求刷新界面
首先在一个工具类中写上一条你要写的sql语句代码如下:
package com.ebizwindow.crm.utils;
import java.util.List;
import com.ebizwindow.crm.constants.SqlConst;
import com.ebizwindow.crm.constants.TableConst;
import com.ebizwindow.crm.model.TableDefinition;
import com.ebizwindow.crm.portlet.base.SystemStatus;
import com.ebizwindow.crm.service.OpportunityLocalServiceUtil;
import com.ebizwindow.crm.service.TableDefinitionLocalServiceUtil;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.util.StringPool;
public class SQLUtil {
private static final String PK_COLUMN_CREATEUSERID = "createUserId";
private static final String PK_COLUMN_EDITUSERID = "editUserId";
private static final String PK_COLUMN_AUDITUSERID = "auditUserId";
private static final String PK_COLUMN_CLOSEUSERID = "closeUserId";
private static final String PK_COLUMN_CONFIRMUSERID = "confirmUserId";
private static final String PK_COLUMN_REQUESTUSERID = "requestUserId";
private static final String PK_COLUMN_EXECUTORID = "executorId";
private static final String PK_COLUMN_SUBMITUSERID = "submitUserId";
private static final String PK_COLUMN_OWNERID = "ownerId";
private static final String PK_COLUMN_UPID = "upId";
private static final String PK_COLUMN_CUSTOMERID = "customerId";
private static final String PK_COLUMN_CONTACTID = "contactId";
private static final String PK_COLUMN_CONTRACTID = "contractId";
private static final String PK_COLUMN_OPPORTUNITYID = "opportunityId";
private static final String PK_COLUMN_QUOTATIONID = "quotationId";
private static final String PK_COLUMN_CLUEID = "clueId";
private static final String PK_COLUMN_ACTIVITYID = "activityId";
private static final String PK_COLUMN_MARKETID = "marketId";
private static final String PK_COLUMN_SALESTEMPLATEID = "salesTemplateId";
private static final String PK_COLUMN_DEPARTMENTID = "departmentId";
private static final String PK_COLUMN_PRODUCTID = "productId";
private static final String PK_COLUMN_PROJECTID = "projectId";
public static String getQueryValue(String queryValue, String columnName, long companyId) throws SystemException {
String results = StringPool.BLANK;
String query = StringPool.BLANK;
if (columnName.equals(PK_COLUMN_CREATEUSERID)
|| columnName.equals(PK_COLUMN_EDITUSERID)
|| columnName.equals(PK_COLUMN_AUDITUSERID)
|| columnName.equals(PK_COLUMN_OWNERID)
|| columnName.equals(PK_COLUMN_CLOSEUSERID)
|| columnName.equals(PK_COLUMN_CONFIRMUSERID)
|| columnName.equals(PK_COLUMN_REQUESTUSERID)
|| columnName.equals(PK_COLUMN_SUBMITUSERID)
|| columnName.equals(PK_COLUMN_EXECUTORID) ) {
query = "select userId from User_ where firstName like '%" + queryValue + "%'";
} else if (columnName.equals(PK_COLUMN_UPID) || columnName.equals(PK_COLUMN_CUSTOMERID)) {
query = "select customerId from CRM_Customer where chineseName like '%" + queryValue + "%'";
} else if (columnName.equals(PK_COLUMN_CONTACTID)) {
query = "select contactId from CRM_Contact where chineseName like '%" + queryValue + "%'";
} else if (columnName.equals(PK_COLUMN_MARKETID)) {
query = "select marketId from CRM_Market where name like '%" + queryValue + "%'";
} else if (columnName.equals(PK_COLUMN_CLUEID)) {
query = "select clueId from CRM_Clue where name like '%" + queryValue + "%'";
} else if (columnName.equals(PK_COLUMN_OPPORTUNITYID)) {
query = "select opportunityId from CRM_Opportunity where topic like '%" + queryValue + "%'";
} else if (columnName.equals(PK_COLUMN_QUOTATIONID)) {
query = "select quotationId from CRM_Quotation where name like '%" + queryValue + "%'";
} else if (columnName.equals(PK_COLUMN_CONTRACTID)) {
query = "select contractId from CRM_Contract where name like '%" + queryValue + "%'";
} else if (columnName.equals(PK_COLUMN_ACTIVITYID)) {
query = "select activityId from CRM_Activity where name like '%" + queryValue + "%'";
} else if (columnName.equals(PK_COLUMN_SALESTEMPLATEID)) {
query = "select salesTemplateId from CRM_SalesTemplate where name like '%" + queryValue + "%'";
} else if (columnName.equals(PK_COLUMN_PRODUCTID)) {
query = "select productId from CRM_Product where name like '%" + queryValue + "%'";
} else if (columnName.equals(PK_COLUMN_DEPARTMENTID)) {
query = "select departmentId from OPERATOR_Department where departmentName like '%" + queryValue + "%'";
} else if (columnName.equals(PK_COLUMN_PROJECTID)) {
query = "select projectId from CRM_Project where name like '%" + queryValue + "%'";
}
query += " and companyId = '" + companyId + "'";
List<Long> entityIDs = OpportunityLocalServiceUtil.searchBySQLQueryString(query, -1, -1);
String entityIDsStr = entityIDs.toString();
results = StringPool.OPEN_PARENTHESIS + entityIDsStr.subSequence(1, entityIDsStr.length() - 1) + StringPool.CLOSE_PARENTHESIS;
return results;
}
//private static Log _log = LogFactoryUtil.getLog(BasePortlet.class);
public static String symbolToString(String symbol, String value) {
String str = StringPool.BLANK;
if (!symbol.equals(StringPool.BLANK)) {
if (symbol.equals("eq") || symbol.equals(StringPool.EQUAL)) {
str = " = '" + value + "'";
} else if (symbol.equals("gt") || symbol.equals(StringPool.GREATER_THAN)) {
str = " > '" + value + "'";
} else if (symbol.equals("lt") || symbol.equals(StringPool.LESS_THAN)) {
str = " < '" + value + "'";
} else if (symbol.equals("gteq") || symbol.equals(StringPool.GREATER_THAN_OR_EQUAL)) {
str = " >= '" + value + "'";
} else if (symbol.equals("lteq") || symbol.equals(StringPool.LESS_THAN_OR_EQUAL)) {
str = " <= '" + value + "'";
} else if (symbol.equals("ne") || symbol.equals(StringPool.NOT_EQUAL)) {
str = " <> '" + value + "'";
} else if (symbol.equals("c")) {
str = " like '%" + value + "%'";
} else if (symbol.equals("sl")) {
str = " like '" + value + "%'";
} else if (symbol.equals("sr")) {
str = " like '%" + value + "'";
} else if (symbol.equals("nn")) {
str = " <> '' ";
} else if (symbol.equals("n")) {
str = " = '' ";
} else if (symbol.equals("isn")) {
str = " is null ";
} else if (symbol.equals("!eq")) {
str = " != '" + value + "'";
} else if (symbol.equals("tc")) {
str = " in " + value + " ";
}
} else {
str = " = '' ";
}
return str;
}
public static String getActivitySQL(long userId) throws SystemException {
StringBuffer sb = new StringBuffer("select activity.activityId from CRM_Activity activity where (activity.executorId in ")
.append(OperatorUtil.searchViewOperatorIds(userId,TableConst.ACTIVITY))
.append(" or activity.createUserId in ")
.append(OperatorUtil.searchViewOperatorIds(userId,TableConst.ACTIVITY))
.append(")");
return sb.toString();
}
public static String getCustomerSQL(long userId) throws SystemException {
String sql = "select customer.customerId from CRM_Customer customer where 1=1 and (customer.ownerId in "
+ OperatorUtil.searchViewOperatorIds(userId, TableConst.CUSTOMER) + ")";
return sql;
}
public static String getCustomerSQL4Dialog(long userId) throws SystemException {
String sql = "select customer.customerId from CRM_Customer customer where customer.ownerId = '" + userId + "'";
return sql;
}
public static String getContactSQL(long userId) throws SystemException {
String sql = "select contact.contactId from CRM_Contact contact where (contact.ownerId in "
+ OperatorUtil.searchViewOperatorIds(userId,TableConst.CONTACT) + ")";
return sql;
}
public static String getContactTop10SQL(long userId) throws SystemException {
String sql = "select contact.contactId from CRM_Contact contact where (contact.ownerId in "
+ OperatorUtil.searchViewOperatorIds(userId,TableConst.CONTACT) + ") order by contact.createDate limit 10 ";
return sql;
}
public static String getContractSQL(long userId) throws SystemException {
String sql = "select contract.contractId from CRM_Contract contract where (contract.ownerId in "
+ OperatorUtil.searchViewOperatorIds(userId,TableConst.CONTRACT) + ")";
return sql;
}
public static String getMarketSQL(long userId) throws SystemException {
String sql = "select market.marketId from CRM_Market market where (market.ownerId in "
+ OperatorUtil.searchViewOperatorIds(userId,TableConst.MARKET) + ")";
return sql;
}
public static String getClueSQL(long userId) throws SystemException {
String sql = "select clue.clueId from CRM_Clue clue where (clue.ownerId in "
+ OperatorUtil.searchViewOperatorIds(userId,TableConst.CLUE) + ") and clue.auditStatus='"+SystemStatus.Audit.getStatus()+"'";
return sql;
}
public static String getOpportunitySQL(long userId) throws SystemException {
String sql = "select opportunity.opportunityId from CRM_Opportunity opportunity where (opportunity.ownerId in "
+ OperatorUtil.searchViewOperatorIds(userId,TableConst.OPPORTUNITY) + ")";
return sql;
}
public static String getOpportunityTop10SQL(long userId) throws SystemException {
String sql = "select opportunity.opportunityId from CRM_Opportunity opportunity where (opportunity.ownerId in "
+ OperatorUtil.searchViewOperatorIds(userId,TableConst.OPPORTUNITY) + ") order by opportunity.createDate limit 10";
return sql;
}
public static String getQuotationSQL(long userId) throws SystemException {
String sql = "select quotation.quotationId from CRM_Quotation quotation where (quotation.ownerId in "
+ OperatorUtil.searchViewOperatorIds(userId,TableConst.QUOTATION) + ")";
return sql;
}
public static String getOrderSQL(long userId) throws SystemException {
String sql = "select order_.orderId from CRM_Order order_ where (order_.ownerId in "
+ OperatorUtil.searchViewOperatorIds(userId,TableConst.ORDER) + ")";
return sql;
}
public static String getProductSQL(long companyId) throws SystemException {
String sql = "select product.productId from CRM_Product product where product.companyId = '" + companyId + "'";
return sql;
}
public static String getProjectSQL(long companyId) throws SystemException {
String sql = "select project.projectId from CRM_Project project where project.companyId = '" + companyId + "'";
return sql;
}
public static String getRPlanSQL(long userId) throws SystemException {
String sql = "select receivablesPlan.receivablesPlanId from CRM_ReceivablesPlan receivablesPlan where (receivablesPlan.ownerId in "
+ OperatorUtil.searchViewOperatorIds(userId,TableConst.RPLAN) + ")";
return sql;
}
public static String getRRecordSQL(long userId) throws SystemException{
String sql = "select receivablesRecord.receivablesRecordId from CRM_ReceivablesRecord receivablesRecord where (receivablesRecord.ownerId in "
+ OperatorUtil.searchViewOperatorIds(userId,TableConst.RRECORD) + ")";
return sql;
}
public static String getCreditRightsSQL(long userId) throws SystemException{
String sql = "select credit.CRId from CR_CreditRights credit where (credit.ownerId in " +
OperatorUtil.searchViewOperatorIds(userId,TableConst.CreditRights)+" ) ";
return sql;
}
//得到部门下的所有的用户
public static String getOperatorSQL(long departmentId) throws SystemException{
//select operator.operatorId from Operator_operator as operator where operator.departmentId in (204);
String sql = "select operator.operatorId from Operator_operator as operator where (operator.operatorId in "+OperatorUtil.searchViewOperatorIds(departmentId,TableConst.OPERATOR_Operator)+")";
return sql;
}
public static String getSQLBeginningByTableDefinitionId(long tableDefinitionId) throws PortalException, SystemException {
String result = "";
TableDefinition tableDefinition = TableDefinitionLocalServiceUtil.getTableDefinition(tableDefinitionId);
String tableName = tableDefinition.getTableName();
if (tableName.equals(TableConst.CRM_Customer)) {
result = SqlConst.CUSTOMER_SQL_BEGINNING;
} else if (tableName.equals(TableConst.CRM_Customer)) {
result = SqlConst.CUSTOMER_SQL_BEGINNING;
} else if (tableName.equals(TableConst.CRM_Contact)) {
result = SqlConst.CONTACT_SQL_BEGINNING;
} else if (tableName.equals(TableConst.CRM_Market)) {
result = SqlConst.MARKET_SQL_BEGINNING;
} else if (tableName.equals(TableConst.CRM_Clue)) {
result = SqlConst.CLUE_SQL_BEGINNING;
} else if (tableName.equals(TableConst.CRM_Activity)) {
result = SqlConst.ACTIVITY_SQL_BEGINNING;
} else if (tableName.equals(TableConst.CRM_Opportunity)) {
result = SqlConst.OPPORTUNITY_SQL_BEGINNING;
} else if (tableName.equals(TableConst.CRM_Quotation)) {
result = SqlConst.QUOTATION_SQL_BEGINNING;
} else if (tableName.equals(TableConst.CRM_Contract)) {
result = SqlConst.CONTRACT_SQL_BEGINNING;
} else if (tableName.equals(TableConst.CRM_Product)) {
result = SqlConst.PRODUCT_SQL_BEGINNING;
} else {
result = SqlConst.CUSTOMER_SQL_BEGINNING;
}
return result;
}
public static String filterQuery(String columnName){
if (columnName.equals("type") || columnName.equals("code")) {
return columnName + StringPool.UNDERLINE;
} else {
return columnName;
}
}
//private static Log _log = LogFactoryUtil.getLog(SQLUtil.class);
}
上述红色部分就是相应的代码部分,这个部分的代码,意思是找到所有的id,我们可以根据这个id找到这个实体的对象,就找到相应的数据了。
其次我们需要在我们的项目中写上一个按照sql语句查询的方法,这个是我们自己定义的,因为在liferay中,我们只能定义一些基本的增加修改和删除,在service.xml中我们是不能
做模糊查询的,里面定义的finder全部是精确查询。
我们首先应该在service.persistence这个包中写上一个你要查询的实体的类XXFinderImpl然后继承BasePersistenceImpl实现XXFinder接口比如:
package com.ebizwindow.operator.service.persistence;
import java.util.List;
import com.ebizwindow.operator.model.Operator;
import com.liferay.portal.kernel.dao.orm.Query;
import com.liferay.portal.kernel.dao.orm.QueryUtil;
import com.liferay.portal.kernel.dao.orm.SQLQuery;
import com.liferay.portal.kernel.dao.orm.Session;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.service.persistence.impl.BasePersistenceImpl;
public class OperatorFinderImpl extends BasePersistenceImpl<Operator> implements OperatorFinder{
//自己定义的查询的方法。
public List<Long> findBySQLQueryString(String queryString, int start,
int end) throws SystemException {
List<Long> list = null;
if (list == null) {
Session session = null;
try {
session = openSession();
SQLQuery q = session.createSQLQuery(queryString);
list = (List<Long>) QueryUtil.list(q, getDialect(), start, end);
} catch (Exception e) {
throw new SystemException(e);
} finally {
closeSession(session);
}
}
return list;
}
//自己定义的HQL查询的方法
//传过来的用户的条件是,操作员的name,和role,分页查询的方法
public List<Operator> findOperators(String queryString,int start,int end,String name,String role) throws SystemException{
List<Operator> list = null;
if (list == null) {
Session session = null;
try{
session = openSession();
Query query = session.createQuery(queryString);
query.setString(0, name);
query.setString(1, role);
list = (List) QueryUtil.list(query, getDialect(), start, end);
}catch(Exception e){
throw new SystemException(e);
}finally{
closeSession(session);
}
}
return list;
}
}
然后我们就在portlet中写上自己的实现就行了,比如:
else if(actionName.equals("operator.search")) {//查询的方法
//得到界面上传过来的值
String name = ParamUtil.getString(actionRequest, "customer_name",StringPool.BLANK);
//select * from operator_operator as operator where operator.roleId in
//(select roleId from operator_role where roleName like "%员%" ) and operator.name like "%张妍妍%";
String role = ParamUtil.getString(actionRequest, "customer_role",StringPool.BLANK);
//得到所在的部门
long departmentId = ParamUtil.getLong(actionRequest, "departmentId", 0L);
//根据id,用逗号隔开select roleId from operator_role where roleName like "%员%";
String idsql = "select roleId from OPERATOR_Role where roleName like '%" + role + "%'";
List<Long> ids = OperatorLocalServiceUtil.searchBySQLQueryString(idsql, QueryUtil.ALL_POS, QueryUtil.ALL_POS);
String strsql = ids.toString();
String ss = StringPool.OPEN_PARENTHESIS + strsql.subSequence(1, strsql.length() - 1)+ StringPool.CLOSE_PARENTHESIS;
StringBuffer query = new StringBuffer();
query.append("select operator.operatorId from ");
query.append(TableConst.OPERATOR_Operator);
query.append(" as operator ");
query.append(" where 1=1 ");
if (!"".equals(role) &&!ss.equals("()")) {
query.append(" and ");
query.append(" operator.roleId in ");
query.append(ss);
}
if (!"".equals(name)) {
query.append(" and ");
query.append("operator.name ");
query.append(" like '%");
query.append(name);
query.append("%'");
}
if (departmentId != 0) {
List<Operator> alloperator = getOperatorByDepartmentId(departmentId);
String operatorids = "(";
for (int i = 0;i<alloperator.size();i++) {
operatorids+=alloperator.get(i).getOperatorId();
if (i != alloperator.size()-1) {
operatorids+=",";
}
}
operatorids+=")";
query.append(" and ");
query.append(" operator.operatorId in ");
query.append(operatorids);
}
listOperator(actionRequest,query.toString());
//这个地方就是把前台传过来的name,role传给界面上显示出来。
actionRequest.setAttribute("customer_name", name);
actionRequest.setAttribute("customer_role", role);
forward = "/jsp/operator/operator-list.jsp";
//根据sql语句查找数据
private void listOperator(PortletRequest portletRequest,String query) throws PortalException, SystemException {
List<Long> operatorIds = OperatorLocalServiceUtil.searchBySQLQueryString(query, QueryUtil.ALL_POS, QueryUtil.ALL_POS);//查找所有的
List<Operator> operators = new ArrayList<Operator>();
for (int i = 0;i<operatorIds.size();i++) {
Long operatorId = Long.valueOf(String.valueOf(operatorIds.get(i)));
Operator operator = OperatorLocalServiceUtil.getOperator(operatorId);
operators.add(operator);
}
portletRequest.setAttribute("operators", operators);
}
好吧!后台代码已经写成了,在界面上我们需要定义自己的路径然后找到这个地址。
function search(){
var url ='<%=searchCustomerURL %>';
var customerName = $("input[name='customer_name']").val();
var customerRole = $("input[name='customer_role']").val();
$.get(url, {customer_name:customerName,customer_role:customerRole}, function(response) {
if (response.length > 0) {
//$('#<portlet:namespace/>reportTips').html(treeNode.name);
$('#<portlet:namespace/>reportListBox').empty().html(response);
}
});
}
<portlet:actionURL var="searchCustomerURL" windowState="<%=LiferayWindowState.EXCLUSIVE.toString() %>">
<portlet:param name="operation" value="operator.search"/>
<portlet:param name="departmentId" value="<%=String.valueOf(departmentId) %>"/>
</portlet:actionURL>
<div class="list-wrapper">
<div id="searchCustomer" align="right">
姓名 <input class="" id="aui_3_4_0_1_2004" name="customer_name" id = "customer_name" type="text" value="<%=name %>">
角色 <input class="" id="aui_3_4_0_1_1962" name="customer_role" id = "customer_role" type="text" value = "<%=roleName %>">
<input value="搜索" type="button" onclick="search();">
</div>
很简单的查询就实现了
按照用户名和角色查询用户liferay的更多相关文章
- 阶段5 3.微服务项目【学成在线】_day18 用户授权_07-动态查询用户权限-权限数据模型
3 动态查询用户权限 3.1 需求分析 截至目前在测试授权时使用的权限数据是静态数据,正常情况的流程是: 1.管理员给用户分配权限,权限数据写到数据库中. 2.认证服务在进行用户认证时从数据库读取用户 ...
- windows下怎样测试oracle安装是否成功以及在oracle中创建用户并赋予用户权限;和[Err] ORA-65096: 公用用户名或角色名无效的解决方案
测试oracle数据安装是否成功,可按顺序执行以下两个步骤: 测试步骤 1:请执行操作系统级的命令:tnsping orcl 上述命令假定全局数据库名是 orcl.以下是命令执行后的示例(请在cmd命 ...
- SQL Server中查询用户的对象权限和角色的方法
--SQL Server中查询用户的对象权限和角色的方法 -- 查询用户的object权限 exec sp_helprotect NULL, 'sa' -- 查询用户拥有的role exec sp_h ...
- Oracle12c创建新用户提示公共用户名或角色无效
今天将备份的数据库还原到一台新的电脑上,首先要创建用户,执行如下语句: create user fxhy identified " default tablespace USERS temp ...
- 项目一:第十三天 1、菜单数据管理 2、权限数据管理 3、角色数据管理 4、用户数据管理 5、在realm中动态查询用户权限,角色 6、Shiro中整合ehcache缓存权限数据
1 课程计划 菜单数据管理 权限数据管理 角色数据管理 用户数据管理 在realm中动态查询用户权限,角色 Shiro中整合ehcache缓存权限数据 2 菜单数据添加 2.1 使用c ...
- Oracle 12C ORA-65096: 公用用户名或角色名无效
先说基本用法: 先按11G之前进行 conn / as sysdba; create user test identifed by test; ORA-65096: 公用用户名或角色名无效. 查官方文 ...
- Oracle 查询用户和删除用户
------------------------------- 一.查询用户命令: select username from dba_users; 示例: 二.删除用户命名: drop user 用户 ...
- PHP 开发API接口 注册,登录,查询用户资料
服务端 <?php require 'conn.php'; header('Content-Type:text/html;charset=utf-8'); $action = $_GET['ac ...
- 在查询用户的权限的时候 使用左外连接 和 access数据库中左外连接
一般做视图最好是做成左外连接的.而其作用尤其在我们查询用户当前的权限时尤为明显,我们将 权限表即模块表放→角色权限表→角色表→用户角色表→用户表 就这样left outer join 连接起来,这样就 ...
随机推荐
- php sqlserver及xdebug扩展配置
;extension=php_bz2.dllextension=php_curl.dll;extension=php_fileinfo.dll;extension=php_ftp.dll;extens ...
- Linux 下Redis集群安装部署及使用详解(在线和离线两种安装+相关错误解决方案)
一.应用场景介绍 本文主要是介绍Redis集群在Linux环境下的安装讲解,其中主要包括在联网的Linux环境和脱机的Linux环境下是如何安装的.因为大多数时候,公司的生产环境是在内网环境下,无外网 ...
- 生产环境的gitlab大版本升级思路(从7.x升级到8.x)
之前在生产环境部署的gitlab是7.x版本的,提供给公司内部的员工来使用,大概有350个用户左右,gitlab从8.x版本之后内置了CI和CD的集成,所以就考虑到升级版本的问题 通过参考和总结git ...
- 深入浅出WPF之Binding的使用(一)
在WPF中Binding可以比作数据的桥梁,桥梁的两端分别是Binding的源(Source)和目标(Target).一般情况下,Binding源是逻辑层对象,Binding目标是UI层的控件对象:这 ...
- nagios监控报错 It appears as though you do not have permission to view...
今天在安装完nagios后,通过nagios网页界面点击主机.服务.问题页面时.均报错,报错的内容都差不多.如点击服务,报错: It appears as though you do not have ...
- [Log]ASP.NET之HttpModule拦截404异常
Httpmodule代码: public class Error404Module : IHttpModule { public void Init(HttpApplication context) ...
- SDWebImage第三方库使用注意的一些问题
1.利用"UIImageView+WebCache.h"加载图片数据 例如: UIImage *placeHolderImg = [UIImage imageNamed:@&quo ...
- yii---实现加一或减一
废话少说,直接看: /** * 添加帖子的浏览数 * @author fyz */ public function addViewNum($threadId){ $list = ForumThread ...
- Docker容器挂载宿主目录的情形分析
Docker容器启动的时候,如果要挂载宿主机的一个目录,可以用-v参数指定. 譬如我要启动一个centos容器,宿主机的/test目录挂载到容器的/soft目录,可通过以下方式指定: # docker ...
- 关于htc m9w更新后手机无限重启的解决办法
更新htc sense7.0后,手机无限重启.网上搜了一下,是和谷歌框架冲突的原因,但是机子本身没有root,删除不了gms.只能死马当活马医,把能看到google应用都给删了,就解决了. 步骤: 长 ...