mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-29 05:09:46 +01:00
增加run local
This commit is contained in:
parent
a1b071e38e
commit
2755a35548
4 changed files with 36 additions and 15 deletions
8
main/manager-web/.env.local
Normal file
8
main/manager-web/.env.local
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
/*
|
||||||
|
* @Description: 本地开发环境
|
||||||
|
* @Version: 1.0
|
||||||
|
* @Author: flashily
|
||||||
|
* @LastEditTime: 2025-03-26
|
||||||
|
*/
|
||||||
|
VUE_APP_URL = 'http://localhost:8002/xiaozhi-esp32-api'
|
||||||
|
/*VUE_APP_SERVER_ID = 1 */
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"local": "vue-cli-service serve --mode local",
|
||||||
"serve": "vue-cli-service serve",
|
"serve": "vue-cli-service serve",
|
||||||
"build": "vue-cli-service build"
|
"build": "vue-cli-service build"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,8 @@ import admin from './module/admin.js'
|
||||||
* 如果你想调用8002端口,就用'/xiaozhi-esp32-api/api/v1',请与vue.config.js的devServer配置相结合,方便跨域请求
|
* 如果你想调用8002端口,就用'/xiaozhi-esp32-api/api/v1',请与vue.config.js的devServer配置相结合,方便跨域请求
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
const DEV_API_SERVICE = 'https://apifoxmock.com/m1/5931378-5618560-default'
|
const DEV_API_SERVICE = process.env.VUE_APP_URL == '' ? 'https://apifoxmock.com/m1/5931378-5618560-default' : process.env.VUE_APP_URL
|
||||||
|
|
||||||
// 8002开发完成完成后使用这个
|
// 8002开发完成完成后使用这个
|
||||||
// const DEV_API_SERVICE = '/xiaozhi-esp32-api'
|
// const DEV_API_SERVICE = '/xiaozhi-esp32-api'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -83,15 +83,11 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
this.captchaUuid = getUUID();
|
||||||
this.fetchCaptcha();
|
this.fetchCaptcha();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
fetchCaptcha() {
|
fetchCaptcha() {
|
||||||
if (this.$store.getters.getToken) {
|
|
||||||
goToPage('/home')
|
|
||||||
} else {
|
|
||||||
this.captchaUuid = getUUID();
|
|
||||||
|
|
||||||
Api.user.getCaptcha(this.captchaUuid, (res) => {
|
Api.user.getCaptcha(this.captchaUuid, (res) => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
const blob = new Blob([res.data], {type: res.data.type});
|
const blob = new Blob([res.data], {type: res.data.type});
|
||||||
|
|
@ -102,7 +98,22 @@ export default {
|
||||||
showDanger('验证码加载失败,点击刷新')
|
showDanger('验证码加载失败,点击刷新')
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
// if (this.$store.getters.getToken) {
|
||||||
|
// // goToPage('/home')
|
||||||
|
// } else {
|
||||||
|
// this.captchaUuid = getUUID();
|
||||||
|
|
||||||
|
// Api.user.getCaptcha(this.captchaUuid, (res) => {
|
||||||
|
// if (res.status === 200) {
|
||||||
|
// const blob = new Blob([res.data], {type: res.data.type});
|
||||||
|
// this.captchaUrl = URL.createObjectURL(blob);
|
||||||
|
|
||||||
|
// } else {
|
||||||
|
// console.error('验证码加载异常:', error);
|
||||||
|
// showDanger('验证码加载失败,点击刷新')
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
|
|
||||||
// 封装输入验证逻辑
|
// 封装输入验证逻辑
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue