随笔分类 - rails
摘要:JAVA部分代码: import javax.crypto.Cipher; import javax.crypto.KeyGenerator; import javax.crypto.spec.IvParameterSpec; import javax.crypto.spec.SecretKeySp
阅读全文
摘要:java 代码 public static String signData(String data) throws Exception { try { PrivateKey key = getPrivateKey(); Signature sig = Signature.getInstance("S
阅读全文
摘要:java部分代码: String encBusiData = DataSecurityUtil.encrypt(jsonString.getBytes("UTF-8"), configABS.getValue("jks_key")); public static String encrypt(byt
阅读全文
摘要:def self.get_express_route_test url = 'http://bsp-oisp.sf-express.com/bsp-oisp/sfexpressService' xml = "<Request service='RouteService' lang='zh-CN'><
阅读全文
摘要:def aes_encrypt() cipher = OpenSSL::Cipher::AES.new(128, :CBC) cipher.encrypt cipher.key = "quck7295abvdefgh" data= 'sssssdsadkjak' cipher.iv = "abcde
阅读全文
摘要:系统中的80端口已经因为使用lampp被占用,故不能再次使用nginx来做解析: deploy/staging server "yan.com", user: "root", roles: %w{app db web}, my_property: :my_value set :branch, 'ma
阅读全文
摘要:git地址: https://github.com/capistrano/capistrano 在Gemfile中添加Capistrano和其它用到的插件: group :development do gem 'capistrano' gem 'capistrano-rails' gem 'capi
阅读全文
摘要:因为在某些情况下要使用不存在的列,或者是要新建一个虚拟的model 可以在models下的concerns下新建tableless.rb,代码如下: module Tableless def self.included(base) base.extend(ClassMethods) base.sen
阅读全文
摘要:在使用rspec做单元测试的时候 当测试自己所写的方法的时候一直提示错误 最后的解决方法就是一定要使方法返回true 例如: def set_agent_value if self.agent.nil? self.agent = false end true end
阅读全文

浙公网安备 33010602011771号