oms/backend/database/migrations/20261102000400-add-login-status-to-external-print-accounts.js
liufumingren 969c68f5f9 feat(external-print): 新增外部打单平台与账号管理(接入店管家登录)
- 新增 external_print_platforms(平台基础资料,开发者维护)与 external_print_accounts(账号/密码/cookie/token/登录状态)
- 新增平台账号 CRUD、登录态检查、登录接口;店铺管理下新增「外部打单平台」菜单
- 平台服务按 code 独立存放于 app/lib/printPlatform(dgj.js 实现店管家登录与 GetUserInfo 登录态检查)
- 平台接口 401 自动记录账号登录状态,前端展示状态并支持检查/登录

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-02 18:02:34 +08:00

24 lines
768 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

'use strict';
/**
* 外部打单账号增加 login_status 字段。
*
* 记录最近一次与平台交互的登录状态:1 已登录 / 0 未登录或已失效。
* 由平台服务的统一请求入口维护:平台接口返回 401 时置 0,GetUserInfo 成功时置 1,
* 前端列表直接展示该状态,无需每次手动检查。
*/
module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.addColumn('external_print_accounts', 'login_status', {
type: Sequelize.TINYINT,
allowNull: false,
defaultValue: 0,
comment: '登录状态:1已登录 0未登录/已失效',
});
},
async down(queryInterface) {
await queryInterface.removeColumn('external_print_accounts', 'login_status');
},
};