Commit 1a6b5fe1 authored by wangjiankun's avatar wangjiankun

fix:地址、请求修改

parent b58691f3
......@@ -34,25 +34,15 @@ service.interceptors.request.use(config => {
}
// 参数发出前统一进行加密 白名单内的不进行加密
console.log(config)
if ((config.baseURL + config.url).indexOf('authority') < 0) {
if (config.params) {
console.log(config.params)
config.params = { sign: (new SM4(JSON.stringify(config.params)).encryptEcb()) }
} else {
if (config.data) {
config.headers['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8'
console.log(JSON.stringify(config.data))
const temp = { sign: (new SM4(JSON.stringify(config.data)).encryptEcb()) }
config.data = Qs.stringify(temp, { arrayFormat: 'indices', allowDots: true })
}
}
}
// if(config.data) {
// config.data = Qs.stringify(config.data, { arrayFormat: 'repeat' })
// }
return config
}, error => {
console.log(error)
Promise.reject(error)
})
// 响应拦截器
service.interceptors.response.use(res => {
/* // 判断 loading 状态
......
......@@ -75,6 +75,7 @@
import { Store } from '@/utils/storage'
import { storeKey } from '@/utils/auth'
import { Login } from './apis'
import request from '@/utils/request'
export default {
name: 'Login',
data() {
......@@ -114,6 +115,12 @@ export default {
created() {
this.getCode()
this.getCookie()
request({
method: 'post',
data: { }, // post/put 用此传参
// params: {}, // get 用此传参
url: '/contract/contract/add'
})
},
methods: {
goDetail(path) {
......
......@@ -42,7 +42,7 @@ module.exports = {
[process.env.VUE_APP_BASE_API]: {
// target: `http://10.5.87.231:10010/`,
// target: `http://zt.51newsoftware.com:10184/`,
target: 'http://zt.91isoft.com:10184/',
target: 'http://117.122.212.101:8090/',
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: ''
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment