- Update default login email to xinmi@local.com - Update default password to 12345678 (and bcrypt hash in crm.sql) - Add example customers, products, and contracts to init SQL - Fix Docker env interpolation for VITE_API_BASE_URL - Hardcode local backend API URL in frontend .env files - Update README and docs to reflect new default credentials
This commit is contained in:
+2
-2
@@ -1,3 +1,3 @@
|
||||
# .env.development
|
||||
VITE_API_BASE_URL=http://127.0.0.1:8000/api
|
||||
VITE_FILE_UPLOAD_URL=http://127.0.0.1:8000/api/common/file/upload
|
||||
VITE_API_BASE_URL=http://localhost:11001/api
|
||||
VITE_FILE_UPLOAD_URL=http://localhost:11001/api/common/file/upload
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
# .env.production
|
||||
VITE_API_BASE_URL=https://zocrm.cloud/api
|
||||
VITE_FILE_UPLOAD_URL=https://zocrm.cloud/api/common/file/upload
|
||||
VITE_API_BASE_URL=http://localhost:11001/api
|
||||
VITE_FILE_UPLOAD_URL=http://localhost:11001/api/common/file/upload
|
||||
@@ -10,10 +10,6 @@ RUN npm install
|
||||
|
||||
COPY . .
|
||||
|
||||
# Set the production API URL
|
||||
ARG VITE_API_BASE_URL
|
||||
ENV VITE_API_BASE_URL=${VITE_API_BASE_URL}
|
||||
|
||||
RUN npm run build
|
||||
|
||||
FROM nginx:alpine
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
import axios from 'axios';
|
||||
import { message } from 'ant-design-vue';
|
||||
|
||||
axios.defaults.baseURL = import.meta.env.VITE_API_BASE_URL
|
||||
console.log('DEBUG: import.meta.env.VITE_API_BASE_URL =', import.meta.env.VITE_API_BASE_URL);
|
||||
|
||||
const request = axios.create({
|
||||
// timeout: 5000,`
|
||||
baseURL: import.meta.env.VITE_API_BASE_URL || '/api',
|
||||
// timeout: 5000,
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8'
|
||||
}
|
||||
})
|
||||
|
||||
console.log('DEBUG: axios baseURL =', request.defaults.baseURL);
|
||||
|
||||
request.interceptors.request.use(config => {
|
||||
config.headers['uid'] = localStorage.getItem('uid')
|
||||
config.headers['token'] = localStorage.getItem('token')
|
||||
|
||||
@@ -44,7 +44,7 @@ import { initDatabase } from '../api/common';
|
||||
|
||||
// 初始化数据库(只会在生产环境中初始化)
|
||||
onMounted(() => {
|
||||
if (formData.email == '1655064994@qq.com') {
|
||||
if (formData.email == 'xinmi@local.com') {
|
||||
message.loading('正在初始化数据...', 2.5).then(() => {
|
||||
initDatabase().then((res) => {
|
||||
if (res.data.code == 0) {
|
||||
@@ -61,8 +61,8 @@ onMounted(() => {
|
||||
const router = useRouter()
|
||||
|
||||
const formData = reactive({
|
||||
email: '1655064994@qq.com',
|
||||
password: '1655064994',
|
||||
email: 'xinmi@local.com',
|
||||
password: '12345678',
|
||||
remember: true,
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user