修复请求问题
This commit is contained in:
parent
b711e87f50
commit
eb2b6c15f2
|
|
@ -33,9 +33,9 @@ const http = axios.create({
|
||||||
http.interceptors.request.use(config => {
|
http.interceptors.request.use(config => {
|
||||||
config.headers['token'] = Vue.cookie.get('token') // 请求头带上token
|
config.headers['token'] = Vue.cookie.get('token') // 请求头带上token
|
||||||
// config.baseURL = $urlMap[$env]
|
// config.baseURL = $urlMap[$env]
|
||||||
const arr = config.url.split('czg/')
|
const arr = config.url.split('admin/')
|
||||||
config.url = baseUrl + (arr.length >= 2 ? arr[1] : arr[0])
|
config.url = baseUrl + (arr.length >= 2 ? arr[1] : arr[0])
|
||||||
config.url = config.url.replace('czg//', 'czg/');
|
config.url = config.url.replace('admin//', 'admin/');
|
||||||
// config.url = "https://dj-api.hnsiyao.cn/czg/"
|
// config.url = "https://dj-api.hnsiyao.cn/czg/"
|
||||||
return config
|
return config
|
||||||
}, error => {
|
}, error => {
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="10" class="login-captcha">
|
<el-col :span="10" class="login-captcha">
|
||||||
<img :src="captchaPath" @click="getCaptcha()" alt="">
|
<img :src="captchaPath" @click="getCaptcha()" alt="">
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
@ -35,6 +35,7 @@
|
||||||
<script>
|
<script>
|
||||||
import { getUUID } from '@/utils'
|
import { getUUID } from '@/utils'
|
||||||
import { entryName } from '@/utils/httpRequest'
|
import { entryName } from '@/utils/httpRequest'
|
||||||
|
import { method } from 'lodash'
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
|
@ -91,9 +92,17 @@
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 获取验证码
|
// 获取验证码
|
||||||
getCaptcha () {
|
async getCaptcha () {
|
||||||
this.dataForm.uuid = getUUID()
|
this.dataForm.uuid = getUUID()
|
||||||
this.captchaPath = this.$http.adornUrl(`indetcode/getCode?uuid=${this.dataForm.uuid}`)
|
const res =await this.$http({
|
||||||
|
url:'indetcode/getCode',
|
||||||
|
method:'get',
|
||||||
|
params:{
|
||||||
|
uuid:this.dataForm.uuid
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(res);
|
||||||
|
this.captchaPath=res.data.data.img
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue