123456789101112131415161718 |
- import crypt from './crypt.js'
- var pdatautil = {}
- export default pdatautil //全局导出对象
- // 用于编码路由参数
- pdatautil.encode = function (json) {
- var encodedata = crypt.base64Encode(JSON.stringify(json))
- return encodedata
- }
- // 用于解码路由参数
- pdatautil.decode = function (data) {
- var decodedata = crypt.base64Decode(data)
- var json = JSON.parse(decodedata)
- return json
- }
|