mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-30 03:01:53 +08:00
style: 格式化代码
This commit is contained in:
parent
baf5d87d32
commit
48427994d4
File diff suppressed because one or more lines are too long
@ -3,9 +3,12 @@ import CryptoJS from 'crypto-js'
|
|||||||
* @word 要加密的内容
|
* @word 要加密的内容
|
||||||
* @keyWord String 服务器随机返回的关键字
|
* @keyWord String 服务器随机返回的关键字
|
||||||
* */
|
* */
|
||||||
export function aesEncrypt(word,keyWord="XwKsGlMcdPMEhR1B"){
|
export function aesEncrypt(word, keyWord = "XwKsGlMcdPMEhR1B") {
|
||||||
var key = CryptoJS.enc.Utf8.parse(keyWord);
|
var key = CryptoJS.enc.Utf8.parse(keyWord);
|
||||||
var srcs = CryptoJS.enc.Utf8.parse(word);
|
var srcs = CryptoJS.enc.Utf8.parse(word);
|
||||||
var encrypted = CryptoJS.AES.encrypt(srcs, key, {mode:CryptoJS.mode.ECB,padding: CryptoJS.pad.Pkcs7});
|
var encrypted = CryptoJS.AES.encrypt(srcs, key, {
|
||||||
return encrypted.toString();
|
mode: CryptoJS.mode.ECB,
|
||||||
|
padding: CryptoJS.pad.Pkcs7
|
||||||
|
});
|
||||||
|
return encrypted.toString();
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
import config from '@/config'
|
import config from '@/config'
|
||||||
const baseUrl = config.baseUrl
|
const baseUrl = config.baseUrl
|
||||||
export const myRequest = (option={})=>{
|
export const myRequest = (option = {}) => {
|
||||||
return new Promise((reslove,reject)=>{
|
return new Promise((reslove, reject) => {
|
||||||
uni.request({
|
uni.request({
|
||||||
url: baseUrl + option.url,
|
url: baseUrl + option.url,
|
||||||
data :option.data,
|
data: option.data,
|
||||||
method:option.method || "GET",
|
method: option.method || "GET",
|
||||||
success: (result) => {
|
success: (result) => {
|
||||||
reslove(result)
|
reslove(result)
|
||||||
},
|
},
|
||||||
fail:(error)=>{
|
fail: (error) => {
|
||||||
reject(error)
|
reject(error)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user