Commit 7c8db0ac authored by 刘春's avatar 刘春

refactor(env): 更新生产环境接口地址

- 修改 .env.production 中的 VITE_API_URL 为新的生产环境地址
- 更新 deploy.js 中的部署路径和删除路径
- 在 menuApi 中添加用户信息作为请求参数
- 调整路由守卫逻辑,移除不必要的应用信息验证
- 优化用户权限验证逻辑
- 更新类型定义,移除未使用的 EleMessage
- 在医生添加页面中,根据操作类型控制密码输入框的显示
- 优化角色列表页面的数据处理
- 更新 vite.config.ts 中的输出目录和代理服务器地址
parent f4cf2089
NODE_ENV=production
# 生产环境接口地址
# VITE_API_URL='http://10.168.1.106:6200'
VITE_API_URL='http://27.221.101.69:6200/fancy'
VITE_API_URL='http://27.221.101.69:8200/fancy'
# VITE_API_URL='http://10.10.8.231:6200/fancy'
......@@ -14,8 +14,8 @@ const config = {
username: 'root', // ssh 用户名
port: '6666', // 端口默认22
password: 'w7DQrI33Q9WQqPS5', // ssh 密码
path: '/mnt/module/msg/', // 操作开始文件夹 可以直接指向配置好的地址
rmpath: '/mnt/module/msg/' // 需要删除的文件夹
path: '/mnt/module2/bi/', // 操作开始文件夹 可以直接指向配置好的地址
rmpath: '/mnt/module2/bi/' // 需要删除的文件夹
};
// const config = {
......@@ -56,7 +56,7 @@ const connectSSh = () => {
})
.then(async () => {
timeTipLog('正在更新');
await sftp.uploadDir(path.resolve('./msg'), config.path);
await sftp.uploadDir(path.resolve('./bi'), config.path);
})
.then(() => {
timeTipLog('部署完成');
......
import { request } from '@/utils/request';
import type { addMenuDto, delMenuDto, getMenuListDto } from '@/types/BiMenu';
import { getUserInfo } from '@/utils/token-util';
/**
* 新增菜单
......@@ -7,7 +8,9 @@ import type { addMenuDto, delMenuDto, getMenuListDto } from '@/types/BiMenu';
* @returns
*/
const addMenu = (data: addMenuDto) =>
request('/bi-manager/menu/addMenu', 'post', data);
request('/bi-manager/menu/addMenu', 'post', data, {
userCode: getUserInfo()?.userInfo.userCode
});
/**
* 新增菜单
......@@ -15,7 +18,9 @@ const addMenu = (data: addMenuDto) =>
* @returns
*/
const editMenu = (data: addMenuDto) =>
request('/bi-manager/menu/editMenu', 'post', data);
request('/bi-manager/menu/editMenu', 'post', data, {
userCode: getUserInfo()?.userInfo.userCode
});
/**
* 删除菜单
......@@ -23,7 +28,9 @@ const editMenu = (data: addMenuDto) =>
* @returns
*/
const delMenu = (data: delMenuDto) =>
request('/bi-manager/menu/delMenu', 'post', data);
request('/bi-manager/menu/delMenu', 'post', data, {
userCode: getUserInfo()?.userInfo.userCode
});
/**
* 查询
......@@ -31,6 +38,8 @@ const delMenu = (data: delMenuDto) =>
* @returns
*/
const getMenuList = (data: getMenuListDto) =>
request('/bi-manager/menu/getMenuList', 'post', data);
request('/bi-manager/menu/getMenuList', 'post', data, {
userCode: getUserInfo()?.userInfo.userCode
});
export default { addMenu, editMenu, delMenu, getMenuList };
......@@ -40,10 +40,9 @@ const _Preview = import.meta.env.VITE_PREVIEW === 'true';
*/
router.beforeEach(async (to) => {
const userInfo = getUserInfo();
const appInfo = getAppInfo();
const appId = _Dev || _Preview ? APPID : userInfo?.appId;
const appId = APPID;
if (!appId || !appInfo) {
if (!appId) {
if (_Pro) {
EleMessage.error('应用标识丢失,请重新进入应用!');
useBackIndex();
......
......@@ -62,6 +62,7 @@ export const useUserStore = defineStore('user', {
const menusold = await this.getMenuData();
this.updateMenuActiveTree(menusold);
const menus = this.transformMenuData(menusold, null);
console.log(menus, 'menus');
const homePath = this.getFirstMenuPath(menus);
this.setMenus(menus);
return { menus, homePath };
......@@ -110,6 +111,7 @@ export const useUserStore = defineStore('user', {
if (!node || node.hidden === 'Y') return node;
return findNearestVisibleParent(node.parent);
}
function traverse(node, parent = null) {
node.parent = parent;
if (node.children && node.children.length > 0) {
......@@ -128,6 +130,7 @@ export const useUserStore = defineStore('user', {
}
}
}
menuList.forEach((item) => traverse(item));
},
......
......@@ -9,7 +9,6 @@ declare global {
const EffectScope: typeof import('vue')['EffectScope']
const ElMessage: typeof import('element-plus/es')['ElMessage']
const ElMessageBox: typeof import('element-plus/es')['ElMessageBox']
const EleMessage: typeof import('ele-admin-plus/es')['EleMessage']
const computed: typeof import('vue')['computed']
const createApp: typeof import('vue')['createApp']
const customRef: typeof import('vue')['customRef']
......@@ -86,7 +85,6 @@ declare module 'vue' {
readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
readonly ElMessage: UnwrapRef<typeof import('element-plus/es')['ElMessage']>
readonly ElMessageBox: UnwrapRef<typeof import('element-plus/es')['ElMessageBox']>
readonly EleMessage: UnwrapRef<typeof import('ele-admin-plus/es')['EleMessage']>
readonly computed: UnwrapRef<typeof import('vue')['computed']>
readonly createApp: UnwrapRef<typeof import('vue')['createApp']>
readonly customRef: UnwrapRef<typeof import('vue')['customRef']>
......
......@@ -110,7 +110,13 @@
},
{ label: '科室名称', prop: 'deptName', type: 'input', required: true },
{ label: '科室编码', prop: 'deptCode', type: 'input', required: true },
{ label: '用户密码', prop: 'userPassword', type: 'input', required: true },
{
label: '用户密码',
vIf: useType.value === 'add',
prop: 'userPassword',
type: 'input',
required: true
},
{ label: '微信id', prop: 'wxId', type: 'input', required: false },
{
label: '权限',
......
......@@ -125,6 +125,7 @@
fetchRoleList();
});
const fetchRoleList = async () => {
isAutoFlag.value = true;
pageLoading.value = true;
const [err, ret] = await tryit(roleApi.getRoleList)({});
if (err) {
......@@ -139,7 +140,12 @@
};
// 切换状态
const isAutoFlag = ref(false);
const handleChangeStatus = async (row) => {
if (isAutoFlag.value) {
isAutoFlag.value = false;
return;
}
pageLoading.value = true;
const [, ret] = await tryit(doctorApi.editUser)(row);
if (ret!.code === 200) {
......@@ -167,6 +173,7 @@
}
if (ret.code === 200) {
rgridOptions.data = ret.data;
rgridOptions.data?.map((item) => (item.status = String(item.status)));
}
pageLoading.value = false;
};
......
......@@ -120,7 +120,7 @@ export default defineConfig(({ command, mode }) => {
},
build: {
target: 'chrome63',
outDir: 'msg',
outDir: 'bi',
// 使用 terser 进行压缩(如追求更快编译,可考虑切换为 'esbuild')
minify: 'esbuild',
terserOptions: {
......@@ -159,7 +159,7 @@ export default defineConfig(({ command, mode }) => {
changeOrigin: true
},
'/bi-manager': {
target: 'http://10.1.0.98:4396',
target: 'http://27.221.101.69:8200/fancy',
changeOrigin: true
}
}
......
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