feat: 迁移项目到 yjyf-app 目录并更新首页路由配置
这个提交包含在:
@@ -7,7 +7,7 @@ const fs = require('fs');
|
||||
const path = require('path');
|
||||
const { execFileSync } = require('child_process');
|
||||
|
||||
const ROOT = '/Users/linda/Desktop/project/uni-preset-vue-vite-ts shanchan/yjyf';
|
||||
const ROOT = process.env.APP_ROOT || process.env.CLIENT_ROOT || path.resolve(__dirname, '../yjyf-app');
|
||||
const API = 'https://yjyf.gzyakj.com.cn/api';
|
||||
const HOST = '8.137.181.63';
|
||||
|
||||
|
||||
@@ -49,8 +49,8 @@ const sql = (s) => execFileSync('ssh', ['-o', 'BatchMode=yes', 'root@8.137.181.6
|
||||
r = await api('/auth/login', { method: 'POST', data: { mobile: uM, code: '999999' } });
|
||||
chk(r.code !== 1, '错误验证码被拒 → toast 文案可展示', r.msg);
|
||||
|
||||
// ── 页面 2:YJYF/YJYF 首页 ─────────────────────────────────
|
||||
page('页面2 首页 YJYF/YJYF');
|
||||
// ── 页面 2:pages/index/index 首页 ─────────────────────────────────
|
||||
page('页面2 首页 pages/index/index');
|
||||
r = await api('/home/index', { token: uToken });
|
||||
chk(r.code === 1 && r.data.cats.length === 15, '首页 15 个类目渲染数据就绪', '实际 ' + (r.data.cats || []).length);
|
||||
chk(r.data.cats.every(c => c.name && c.icon), '每个类目都有 name + icon(图标库可匹配)');
|
||||
|
||||
@@ -128,7 +128,7 @@ const sql = (s) => execFileSync('ssh', ['-o', 'BatchMode=yes', 'root@8.137.181.6
|
||||
|
||||
sec('切回业主身份');
|
||||
r = await api('/auth/switchRole', { method: 'POST', token: token, data: { role: 'user' } });
|
||||
chk(r.code === 1 && r.data.redirect === '/YJYF/YJYF', '切回业主成功', r.data && r.data.redirect);
|
||||
chk(r.code === 1 && r.data.redirect === '/pages/index/index', '切回业主成功', r.data && r.data.redirect);
|
||||
r = await api('/auth/switchRole', { method: 'POST', token: token, data: { role: 'xxx' } });
|
||||
chk(r.code !== 1, '非法角色参数被拦截', r.msg);
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ const sql = (s) => execFileSync('ssh', ['-o', 'BatchMode=yes', 'root@8.137.181.6
|
||||
chk(r.data.merchant.contact === '新经理', '资料已更新');
|
||||
|
||||
r = await api('/auth/switchRole', { method: 'POST', token: token, data: { role: 'user' } });
|
||||
chk(r.code === 1 && r.data.redirect === '/YJYF/YJYF', '切回个人用户', r.data && r.data.redirect);
|
||||
chk(r.code === 1 && r.data.redirect === '/pages/index/index', '切回个人用户', r.data && r.data.redirect);
|
||||
r = await api('/auth/profile', { token: token });
|
||||
chk(r.data.is_merchant === true && Number(r.data.merchant.id) === Number(merchantId), 'profile 携带商家身份', 'merchant_id=' + r.data.merchant.id);
|
||||
|
||||
|
||||
在新工单中引用
屏蔽一个用户