Authored by 陈峰

编译

{
"presets": [
["env", { "modules": false }],
"stage-2"
"es2015"
],
"plugins": ["transform-runtime"],
"comments": false,
"env": {
"test": {
"presets": ["env", "stage-2"],
"plugins": [ "istanbul" ]
}
},
"ignore": [
"node_modules"
]
"plugins": ["transform-runtime"]
}
... ...
... ... @@ -8,6 +8,12 @@ import './filters';
import './directives';
import 'iview/dist/styles/iview.css';
import 'font-awesome/css/font-awesome.css';
import Promise from 'promise-polyfill';
// To add to window
if (!window.Promise) {
window.Promise = Promise;
}
let router = new Router({
routes: Routers,
... ...
... ... @@ -63,7 +63,6 @@ module.exports = {
{
test: /\.js$/,
loader: 'babel-loader',
include: [util.resolve('/')],
exclude: /node_modules/
},
{
... ...
... ... @@ -34,4 +34,9 @@ const component = function editor(resolve) {
}, 'editor');
};
if (!component.name) {
component.name = 'editor';
}
export default component;
... ...
... ... @@ -287,4 +287,4 @@
.btn-row-space {
margin-top: 10px;
}
</style>
</style>
\ No newline at end of file
... ...
... ... @@ -14,11 +14,16 @@ class Rsa {
decrypt(cipherText, Type) {
let plainText = cryptico.decrypt(cipherText, this.mattsRSAkey).plaintext;
if (Type && Type.name === 'Object') {
if (this.getType(Type) === 'Object') {
return JSON.parse(decodeURIComponent(plainText));
}
return plainText;
}
getType(fn) {
let match = fn && fn.toString().match(/^\s*function (\w+)/);
return match && match[1];
}
}
export default new Rsa();
... ...