修复请求问题

This commit is contained in:
YeMingfei666 2025-07-23 10:10:39 +08:00
parent b711e87f50
commit eb2b6c15f2
2 changed files with 14 additions and 5 deletions

View File

@ -33,9 +33,9 @@ const http = axios.create({
http.interceptors.request.use(config => {
config.headers['token'] = Vue.cookie.get('token') // 请求头带上token
// 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 = config.url.replace('czg//', 'czg/');
config.url = config.url.replace('admin//', 'admin/');
// config.url = "https://dj-api.hnsiyao.cn/czg/"
return config
}, error => {

View File

@ -18,7 +18,7 @@
</el-input>
</el-col>
<el-col :span="10" class="login-captcha">
<img :src="captchaPath" @click="getCaptcha()" alt="">
<img :src="captchaPath" @click="getCaptcha()" alt="">
</el-col>
</el-row>
</el-form-item>
@ -35,6 +35,7 @@
<script>
import { getUUID } from '@/utils'
import { entryName } from '@/utils/httpRequest'
import { method } from 'lodash'
export default {
data () {
return {
@ -91,9 +92,17 @@
})
},
//
getCaptcha () {
async getCaptcha () {
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
}
}
}