@xiaoqq
2018-05-24T09:09:14.000000Z
字数 4105
阅读 1226
唯品花
npm install less -g
;关键在于配置路径:
只需要把Output paths to refresh更改为:$ProjectFileDir$\webapp\css\$FileDirName$\$FileNameWithoutExtension$.css
新增:着陆页更改为:
$ProjectFileDir$\webapp\publicity\mh52016111601\$FileNameWithoutExtension$.css
$FileName$ -o $FileNameWithoutExtension$.css
, Workding Directory设置为:$ProjectFileDir$\webapp\css\$FileDirName$\
, Output paths设置为:$ProjectFileDir$\webapp\css\$FileDirName$\$FileNameWithoutExtension$.css
由于在fiddler在本机使用存在诸多问题,经同事介绍,决定使用charles
破解:我使用的是Charles4.x,直接从这篇博客上下载jar包替换即可;
设置HTTPS|HTTP代理:点击某个域,右键,Enable SSL Proxying
移动端访问http://charlesproxy.com/getssl
安装证书。
经常使用install package
没有反应,解决方法是,在Setting-User
中配置:
"channels":
[
"https://raw.githubusercontent.com/AceLiu/channel_v3.json/master/channel_v3.json"
],
使用4个空格代替tab:"translate_tabs_to_spaces": true,
"draw_white_space": "all",
<#include "_titleOrigin.ftl" encoding="utf-8" parse="true">
撤销commit并与线上版本保持同步: git reset --hard origin/F061_XYT_167097606
删除新增的所有问题: git clean -df
weinre --httpPort 8181 --boundHost -all-
生成证书
openssl genrsa 1024 > d:/private.pem
openssl req -new -key d:/private.pem -out d:/csr.pem
openssl x509 -req -days 365 -in d:/csr.pem -signkey d:/private.pem -out d://file.crt
http-server --cert d:\file.crt --key d:\private.pem --ssl --cors -p 443
1. Ctrl + Alt + R,打开Rewrite面板;
2. Enable Rewrite,新增规则;
3. 配置上面:Location: https://mxfd.vipstatic.com/*
4. 配置下面:
a. Remove Header Access-Control-Allow-Origin, where设置为Response
b. Add Header Access-Control-Allow-Origin *, where设置为Response
1. Ctrl + R安装脚本编辑器;
2. 找到函数static function OnBeforeResponse(oSession: Session);
3. 在函数中添加oSession.oResponse["Access-Control-Allow-Origin"] = "*";
4. 保存
<#-- 将ftl中的对象转换成json,只转换hash 和 数组 类型数据-->
<#function objectToJsonFunction object>
<#if object??>
<#if object?is_enumerable>
<#local json = '['>
<#list object as item>
<#if item?is_number >
<#if item_index > 0 && json != "[" >
<#local json = json +',' >
</#if>
<#local json = json + '${item}'>
<#elseif item?is_string>
<#if item_index > 0 && json != "[" >
<#local json = json +',' >
</#if>
<#local json = json + '"${item?html!""?js_string}"'>
<#elseif item?is_boolean >
<#if item_index > 0 && json != "[" >
<#local json = json +',' >
</#if>
<#local json = json + '${item?string("true", "false")}'>
<#elseif item?is_enumerable && !(item?is_method) >
<#if item_index > 0 && json != "[" >
<#local json = json +',' >
</#if>
<#local json = json + objectToJsonFunction(item)>
<#elseif item?is_hash>
<#if item_index > 0 && json != "[" >
<#local json = json +',' >
</#if>
<#local json = json + objectToJsonFunction(item)>
</#if>
</#list>
<#return json + ']'>
<#elseif object?is_hash>
<#local json = "{">
<#assign keys = object?keys>
<#list keys as key>
<#if object[key]?? && !(object[key]?is_method) && key != "class">
<#if object[key]?is_number>
<#if key_index > 0 && json != "{" >
<#local json = json +',' >
</#if>
<#local json = json + '"${key}": ${object[key]}'>
<#elseif object[key]?is_string>
<#if key_index > 0 && json != "{" >
<#local json = json +',' >
</#if>
<#local json = json + '"${key}": "${object[key]?html!""?js_string}"'>
<#elseif object[key]?is_boolean >
<#if key_index > 0 && json != "{" >
<#local json = json +',' >
</#if>
<#local json = json + '"${key}": ${object[key]?string("true", "false")}'>
<#elseif object[key]?is_enumerable >
<#if key_index > 0 && json != "{" >
<#local json = json +',' >
</#if>
<#local json = json + '"${key}":'+ objectToJsonFunction(object[key])>
<#elseif object[key]?is_hash>
<#if key_index > 0 && json != "{" >
<#local json = json +',' >
</#if>
<#local json = json + '"${key}":'+ objectToJsonFunction(object[key])>
</#if>
</#if>
</#list>
<#return json +"}">
</#if>
<#else>
<#return "{}">
</#if>
</#function>
如果传入的参数,有一个为空或不存在,则返回false,否则返回true
<#--判断所有传入的参数是否为空-->
<#function isArrNull datas...>
<#list datas as data>
<#if !(data?? && data != "")>
<#return false>
</#if>
</#list>
<#return true>
</#function>
使用方法:
<#--格式化地区数据-->
<#if isArrNull(stayProvince, stayCity, stayRegion, stayProvinceName, stayCityName, stayRegionName)>
<#assign
addressCode = "${stayProvince},${stayCity},${stayRegion}"
addressValue = "${stayProvinceName},${stayCityName},${stayRegionName}"
>
</#if>