npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@shanghaihengli/ygft-admin-cli

v0.3.1

Published

远景系统管理员 CLI:账号、权限与数据可见范围管理

Downloads

718

Readme

远景系统管理员 CLI

@shanghaihengli/ygft-admin-cli 用于以远景数据库 sa 管理员身份管理业务账号、菜单权限和数据可见范围。

它只适用于 Windows,并通过公司现有的 32 位 Smart ODBC Driver 访问远景数据库。网关模式不输入、不保存数据库账号或密码;工具会确认 Smart ODBC 网关实际返回的是具备 sysadmin 权限的 sa 会话。

安装与启动

npm install -g @shanghaihengli/ygft-admin-cli
ygft-admin

启动后依次手动输入:

  1. 数据库服务地址,例如 101.132.193.205:5555
  2. 数据库名称,例如 ygftmis91hl; 管理员账号和数据库密码均由 Smart ODBC 网关会话提供,不再要求输入。

登录前可执行 ygft-admin doctor 检查 Windows、32 位 PowerShell 和 Smart ODBC Driver。

只验证 Smart ODBC 网关会话、但不进入管理界面:

ygft-admin test-gateway

该命令只输入数据库地址和数据库名称(均不提供默认值);成功时会确认网关返回 sa/sysadmin 会话。

账号与权限命令

users
show <用户代码>
permissions <用户代码>
create <代码> <名称> <部门>
create-contract-user <代码> <名称> <部门>
init-permissions <用户代码>
disable <用户代码>
delete <用户代码> <确认代码>
grant <用户代码> <m_x,m_y>
grant-high <用户代码> <m_x,m_y>
scope <用户代码> <A,B,C>
scope-all <用户代码>
scope-global <用户代码>
test-login <用户代码>
logout

名称中有空格时请用双引号:

create CONTRACT_CREATE "出口合同创建账号" 002

delete 会先扫描业务表中的 usercodesalesmanauditingowner 引用;只要账号已有关联合同或其他业务数据,工具会拒绝永久删除,并应使用 disable 停用。

grant 只能授予普通菜单模块。审批、用户管理等高风险模块必须用 grant-high 并再次输入 YES 确认。

create-contract-user 会建立一个最小权限的出口合同创建账号:仅配置现有“出口合同创建、提交送审”所需的普通模块,并将数据范围限定为账号自身;不会授予审批同意、用户管理或全员数据可见权限。创建后仍应根据实际环境测试业务账号登录。

安全边界

  • 仅接受 Smart ODBC 网关返回身份为 sa 且拥有 sysadmin 的会话。
  • 管理员 CLI 不保存数据库密码;新业务账号密码仅在创建时隐藏输入。
  • scope-global 会影响全员可见性,必须输入 YES
  • logoutexit 会立即结束管理员会话。
  • 本工具管理的是远景系统的 ts_userts_userpopedom 记录;它不应被部署到普通业务用户电脑上。