File tree Expand file tree Collapse file tree 8 files changed +263
-276
lines changed
Expand file tree Collapse file tree 8 files changed +263
-276
lines changed File renamed without changes.
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11import Vue from 'vue'
22import App from './App.vue'
33import './plugins/element.js'
4- import './assets/js' ;
4+ import Api from './api' ;
5+ import Util from './utils' ;
56import '@/assets/css/base.css'
67import "./components/base" ;
78import store from "./store" ;
89import router from './router'
910
11+ Vue . prototype . $api = Api ;
12+ Vue . prototype . $util = Util ;
13+
1014Vue . config . productionTip = false
1115Vue . prototype . BASE_URL = process . env . BASE_URL ;
1216
1317new Vue ( {
1418 router,
1519 store,
1620 render : h => h ( App )
17- } ) . $mount ( '#app' )
21+ } ) . $mount ( '#app' )
Original file line number Diff line number Diff line change @@ -7,15 +7,12 @@ const iv = utf8.parse("qwertyuiop123456");
77const mode = CryptoJS . mode . CBC ;
88const padding = require ( "crypto-js/pad-pkcs7" ) ;
99
10- const default_key = "junbokey12345678 " ;
10+ const default_key = "yuikey0123456789 " ;
1111
1212export default {
1313 encrypt ( data , key ) {
14- let real_key = utf8 . parse (
15- md5 ( key || default_key )
16- . toString ( )
17- . slice ( 0 , 16 )
18- ) ;
14+ if ( typeof data !== "string" ) data = JSON . stringify ( data ) ;
15+ let real_key = utf8 . parse ( md5 ( key || default_key ) . toString ( ) . slice ( 0 , 16 ) ) ;
1916 let bytes = AES . encrypt ( data , real_key , {
2017 iv : iv ,
2118 mode : mode ,
@@ -24,12 +21,8 @@ export default {
2421 return bytes . toString ( ) ;
2522 } ,
2623 decrypt ( data , key ) {
27- if ( ! data ) return null ;
28- let real_key = utf8 . parse (
29- md5 ( key || default_key )
30- . toString ( )
31- . slice ( 0 , 16 )
32- ) ;
24+ if ( ! data || typeof data !== "string" ) return '' ;
25+ let real_key = utf8 . parse ( md5 ( key || default_key ) . toString ( ) . slice ( 0 , 16 ) ) ;
3326 let bytes = AES . decrypt ( data , real_key , {
3427 iv : iv ,
3528 mode : mode ,
You can’t perform that action at this time.
0 commit comments