mirror of
https://github.com/ZZZure/ZZZ-Plugin.git
synced 2025-12-16 21:27:47 +00:00
fix:字符串适配
This commit is contained in:
parent
5c26e690ef
commit
9061bcbaa7
1 changed files with 2 additions and 2 deletions
|
|
@ -28,8 +28,8 @@ export const getStoken = (e, mysid = '') => {
|
|||
// 解析文件
|
||||
const cks = YAML.parse(file);
|
||||
for (const ck in cks) {
|
||||
if (cks?.[ck]?.['stuid'] && cks[ck]['stuid'] === mysid) {
|
||||
// 如果 ck 存在并且 stuid 与 mysid 相同则返回(这两者都是字符串,不需要类型转换,因此不需要使用弱比较,强比较速度更快,没有隐式转换一步骤,注意代码规范与代码风格)
|
||||
if (cks?.[ck]?.['stuid'] && String(cks[ck]['stuid']) === String(mysid)) {
|
||||
// 如果 ck 存在并且 stuid 与 mysid 相同则返回
|
||||
return cks[ck];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue