guanwei 1.3.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{index-O2O9peYE.js → index-BZTUsUN1.js} +22 -22
- package/dist/assets/index-BZTUsUN1.js.map +1 -0
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/server/src/data/db.json +210 -0
- package/server/src/data/guanwei.db +0 -0
- package/server/src/services/chartBrief.ts +10 -0
- package/shared/core/data/ziwei.ts +4 -0
- package/shared/core/engine/ziwei.ts +54 -1
- package/shared/core/types.ts +4 -0
- package/dist/assets/index-O2O9peYE.js.map +0 -1
package/dist/index.html
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>观微 · 玄学问道 —— 九术参详,观微知著</title>
|
|
8
8
|
<meta name="description" content="以纸墨留白为骨,融四柱八字、紫微斗数、奇门遁甲、梅花易数、六爻、大六壬、小六壬、星盘、塔罗九术于一体。观微知著,以术问道。" />
|
|
9
|
-
<script type="module" crossorigin src="/assets/index-
|
|
9
|
+
<script type="module" crossorigin src="/assets/index-BZTUsUN1.js"></script>
|
|
10
10
|
<link rel="stylesheet" crossorigin href="/assets/index-hLV3S-Cj.css">
|
|
11
11
|
</head>
|
|
12
12
|
<body>
|
package/package.json
CHANGED
package/server/src/data/db.json
CHANGED
|
@@ -7011,6 +7011,216 @@
|
|
|
7011
7011
|
"records": [],
|
|
7012
7012
|
"token": "2b11d5c2b970d9bc3008817430f29f91ec5fa9626800751ea2a2975f5fea862c",
|
|
7013
7013
|
"tokenExpires": 1791284036799
|
|
7014
|
+
},
|
|
7015
|
+
{
|
|
7016
|
+
"username": "联调7940",
|
|
7017
|
+
"passHash": "scrypt$039833e9b6b5e4d523835e2fca4217b7$dde6cd234081c49ef69624d7ff4b0d04d156b7dc4938c4d35f25a6e84a759800a2afda601717bbd42bdb05ba0663abe8918d2bd711ab5632309788cbb2766c4f",
|
|
7018
|
+
"createdAt": 1788700448015,
|
|
7019
|
+
"profile": {
|
|
7020
|
+
"birthDate": "1996-09-09",
|
|
7021
|
+
"birthHourIndex": 5,
|
|
7022
|
+
"gender": "男",
|
|
7023
|
+
"location": null
|
|
7024
|
+
},
|
|
7025
|
+
"samples": [],
|
|
7026
|
+
"records": [
|
|
7027
|
+
{
|
|
7028
|
+
"artId": "bazi",
|
|
7029
|
+
"createdAt": 1,
|
|
7030
|
+
"result": {
|
|
7031
|
+
"dayGZ": "壬申"
|
|
7032
|
+
}
|
|
7033
|
+
}
|
|
7034
|
+
],
|
|
7035
|
+
"token": "ebde76f3ccd970b20784e0037e02bd6243eb230c66fc6af0910bebcd60b7e38f",
|
|
7036
|
+
"tokenExpires": 1791292448095
|
|
7037
|
+
},
|
|
7038
|
+
{
|
|
7039
|
+
"username": "鉴权8199",
|
|
7040
|
+
"passHash": "scrypt$06230da478e01028cb4ba9bfadf1672b$6a64a0354d95003bc28abe28ef7bd968c81a1eae637c748bc7068175ab417b6556eeac8be7315a0b39585f28940800c82b0d7f2a75d0b95f2be9aabab4ead2aa",
|
|
7041
|
+
"createdAt": 1788700448250,
|
|
7042
|
+
"profile": {
|
|
7043
|
+
"birthDate": "1999-01-01"
|
|
7044
|
+
},
|
|
7045
|
+
"samples": [],
|
|
7046
|
+
"records": [],
|
|
7047
|
+
"token": "59043b826547e55188ac8a6eaf27102b6b7a03d5cf7f0cdc74db1fc2e6a77fa8",
|
|
7048
|
+
"tokenExpires": 1791292448250
|
|
7049
|
+
},
|
|
7050
|
+
{
|
|
7051
|
+
"username": "他人8275",
|
|
7052
|
+
"passHash": "scrypt$178fb7cb4b63abe01543c14222713f0f$7580476cc4239262e139fd7820a7854b58137de0165bdcc176f5c9d07015a53efa12a0d7f17218353479b64bc9782df2fac89451002dc948cf97186341d7d098",
|
|
7053
|
+
"createdAt": 1788700448311,
|
|
7054
|
+
"profile": {},
|
|
7055
|
+
"samples": [],
|
|
7056
|
+
"records": [],
|
|
7057
|
+
"token": "e7f63a5d3f3c2f257ae26cd21633d3978b978a8db9b1f4177c3adc89d8c5e443",
|
|
7058
|
+
"tokenExpires": 1791292448311
|
|
7059
|
+
},
|
|
7060
|
+
{
|
|
7061
|
+
"username": "轮换8319",
|
|
7062
|
+
"passHash": "scrypt$07372a0a04e2daf8858d6fff2eedf005$abe8836a4694e6335e27d62da62e12cd561bf0e419d9017825bcc60261101db78b5bfabf0e4c4a94e457751967f5e752049e7aeeb95f2ce799a3ac733c53a97b",
|
|
7063
|
+
"createdAt": 1788700448371,
|
|
7064
|
+
"profile": {},
|
|
7065
|
+
"samples": [],
|
|
7066
|
+
"records": [],
|
|
7067
|
+
"token": "91e56402988afc1c695e29a8e36d2e824d1295ab0b6386a6e70a9df3e047bb86",
|
|
7068
|
+
"tokenExpires": 1791292448419
|
|
7069
|
+
},
|
|
7070
|
+
{
|
|
7071
|
+
"username": "占位8432",
|
|
7072
|
+
"passHash": "scrypt$0e78eb0844bd2e61b6a980bf1e48f04c$88c7e674a51e26a47eeb319605525630acdd00c795e043e76374a89ff0d8d762c57c09a6e7f14e0e00d71b9941d90e345b515bb60e415673d01e25fa8d8dcde0",
|
|
7073
|
+
"createdAt": 1788700448438,
|
|
7074
|
+
"profile": {},
|
|
7075
|
+
"samples": [],
|
|
7076
|
+
"records": [],
|
|
7077
|
+
"token": "7fb9bcf19170dbaa8e5183f6e26f48a17b347e54c299ffe81cdffc37d6a93913",
|
|
7078
|
+
"tokenExpires": 1791292448567
|
|
7079
|
+
},
|
|
7080
|
+
{
|
|
7081
|
+
"username": "甲8589",
|
|
7082
|
+
"passHash": "scrypt$5b22773befa4cc20b5697c81e5f56891$dde906b58d19556c2b9bff4cdbffe680e0994168d1d8c1044eb9f7b488e127a891d4115c03e734c689d171ce51d729a6d1361d74e0e202475a7564e24e4a7183",
|
|
7083
|
+
"createdAt": 1788700448695,
|
|
7084
|
+
"profile": {},
|
|
7085
|
+
"samples": [],
|
|
7086
|
+
"records": [],
|
|
7087
|
+
"token": "da9884982f3f2281cdc9fc1411590720c50b1e200e734dd55b2cfb7c870b8a20",
|
|
7088
|
+
"tokenExpires": 1791292448696
|
|
7089
|
+
},
|
|
7090
|
+
{
|
|
7091
|
+
"username": "乙8589",
|
|
7092
|
+
"passHash": "scrypt$140fc3bdb37c3a72c99903e060518845$d1c52b03020434a4ba63eb962da8ec9876459a0bc7770bf69d4596bb4b7b5b1c1988439992068c4517226e1bb66ad4d575866191e8820d99f5d5666762bba591",
|
|
7093
|
+
"createdAt": 1788700448734,
|
|
7094
|
+
"profile": {},
|
|
7095
|
+
"samples": [],
|
|
7096
|
+
"records": [],
|
|
7097
|
+
"token": "1967295f1580f40a09517f117ecdd950abc50743f857cdd9591c4b960c2b5188",
|
|
7098
|
+
"tokenExpires": 1791292448734
|
|
7099
|
+
},
|
|
7100
|
+
{
|
|
7101
|
+
"username": "列删8778",
|
|
7102
|
+
"passHash": "scrypt$25f27edffcca0c4d4db67729b67f33d8$09ead02cf6099535c3309ef8269ab03c3ca2d8e6a4ee2f4f3c227167f8f9683463434106c46eaa56ab6b53548304331ecb7f21e84e5fa29738af85f186df634e",
|
|
7103
|
+
"createdAt": 1788700448823,
|
|
7104
|
+
"profile": {},
|
|
7105
|
+
"samples": [],
|
|
7106
|
+
"records": [],
|
|
7107
|
+
"token": "12bc0cf852d243828700895af47d1cad0509130538aeb1c9647a4729945e3702",
|
|
7108
|
+
"tokenExpires": 1791292448823
|
|
7109
|
+
},
|
|
7110
|
+
{
|
|
7111
|
+
"username": "删乙8778",
|
|
7112
|
+
"passHash": "scrypt$1c3211b78fa02c9c815b3342e2b843b3$b51ee4874f27bf61e2221dedce6f52b255ed4eca6dd4b3182fb01dd12889b2531a8162e39c914a5d3fa1d457cf387d7afe85dd55a97a03a9b0602dab19edea23",
|
|
7113
|
+
"createdAt": 1788700448875,
|
|
7114
|
+
"profile": {},
|
|
7115
|
+
"samples": [],
|
|
7116
|
+
"records": [],
|
|
7117
|
+
"token": "e32b75453c915ce7772ee1cfa285329ed80be466f3e4d04d2827bfdd745c77f4",
|
|
7118
|
+
"tokenExpires": 1791292448875
|
|
7119
|
+
},
|
|
7120
|
+
{
|
|
7121
|
+
"username": "联调0883",
|
|
7122
|
+
"passHash": "scrypt$1dd9e9208524cdc17aacc2b4f42d42ac$71eb6f03dbc1730fee8156f8e79ba0c8c5df8056c8d168685226164eeca09c23ff0c63929de8376991b454a130f943a4188de890f1ea8265bc17464b74b52e5d",
|
|
7123
|
+
"createdAt": 1788700480945,
|
|
7124
|
+
"profile": {
|
|
7125
|
+
"birthDate": "1996-09-09",
|
|
7126
|
+
"birthHourIndex": 5,
|
|
7127
|
+
"gender": "男",
|
|
7128
|
+
"location": null
|
|
7129
|
+
},
|
|
7130
|
+
"samples": [],
|
|
7131
|
+
"records": [
|
|
7132
|
+
{
|
|
7133
|
+
"artId": "bazi",
|
|
7134
|
+
"createdAt": 1,
|
|
7135
|
+
"result": {
|
|
7136
|
+
"dayGZ": "壬申"
|
|
7137
|
+
}
|
|
7138
|
+
}
|
|
7139
|
+
],
|
|
7140
|
+
"token": "bd3bff106e28e0123469ceb0e0a83343c979d85bf695d825de5d92f251a6cd25",
|
|
7141
|
+
"tokenExpires": 1791292481013
|
|
7142
|
+
},
|
|
7143
|
+
{
|
|
7144
|
+
"username": "鉴权1137",
|
|
7145
|
+
"passHash": "scrypt$ebf8c79bc9a9dd2fdb4e56eee420b9c4$fa777428b471e026246bde4ae21004ceff7a1364661b6f13f3cf6148ce58c317a4894d65573f84c6180713bfaf59eac9f8a13fc523e283bf7f1dd3ba777f990e",
|
|
7146
|
+
"createdAt": 1788700481175,
|
|
7147
|
+
"profile": {
|
|
7148
|
+
"birthDate": "1999-01-01"
|
|
7149
|
+
},
|
|
7150
|
+
"samples": [],
|
|
7151
|
+
"records": [],
|
|
7152
|
+
"token": "e60b6e6c4287b29ee50ea3d69c224c01d4e3b51b9e9ad666a1778967e0d8e60c",
|
|
7153
|
+
"tokenExpires": 1791292481175
|
|
7154
|
+
},
|
|
7155
|
+
{
|
|
7156
|
+
"username": "他人1199",
|
|
7157
|
+
"passHash": "scrypt$d69b6dd2667d536196630cc5ad1ea523$38cf7d7182ac912f3d73c9ed9cbee6602ddd85fdb6d5fba16535ea90f840106a5d1ad1e340e90a3e4ddb1874eaf10b2a3105bb3dd507b4a1cf3f30308a9af614",
|
|
7158
|
+
"createdAt": 1788700481247,
|
|
7159
|
+
"profile": {},
|
|
7160
|
+
"samples": [],
|
|
7161
|
+
"records": [],
|
|
7162
|
+
"token": "c987b8fe53678bac4d9dbd3a681b3e9f5e7e00579deb8f2b1a9ca76fe225cf5e",
|
|
7163
|
+
"tokenExpires": 1791292481247
|
|
7164
|
+
},
|
|
7165
|
+
{
|
|
7166
|
+
"username": "轮换1256",
|
|
7167
|
+
"passHash": "scrypt$9a720647dce5ef381be0134f8bf2532c$3c344498b9ecaf27d88dd4aff83e7d5347762e5d330160a5e547ddbf32ccc9fbeeb34e2ae0a092a8ec5d67282b9de1f2d0243dfb724e682a1b29c1af7678a2d7",
|
|
7168
|
+
"createdAt": 1788700481299,
|
|
7169
|
+
"profile": {},
|
|
7170
|
+
"samples": [],
|
|
7171
|
+
"records": [],
|
|
7172
|
+
"token": "19b8192e212df6db3f61bddbc8a790cc45bca692f79257c1a76b33ff71c36cde",
|
|
7173
|
+
"tokenExpires": 1791292481358
|
|
7174
|
+
},
|
|
7175
|
+
{
|
|
7176
|
+
"username": "占位1370",
|
|
7177
|
+
"passHash": "scrypt$f9ff2f0bd73ebabfdc3635dabd8a6385$c125da930710ea3860d3e06c19c3e8caa75bab5c5792480ec23bdbf17ef276c2c53bb9fecbbfbde0b6b698188cfdb1355f62873ce96a891cd51f8fadba5c173b",
|
|
7178
|
+
"createdAt": 1788700481374,
|
|
7179
|
+
"profile": {},
|
|
7180
|
+
"samples": [],
|
|
7181
|
+
"records": [],
|
|
7182
|
+
"token": "66ec6a251dbf2901ec4ecd41e06d5bbc0951250a01d6ce0613ccc3721e71d577",
|
|
7183
|
+
"tokenExpires": 1791292481456
|
|
7184
|
+
},
|
|
7185
|
+
{
|
|
7186
|
+
"username": "甲1458",
|
|
7187
|
+
"passHash": "scrypt$097429de4457c56c9a0bb8fc6e759c0a$91b4e79ed3ec34442baa94ca2cd5de2a15380fd92dc175624ef84ec595ca3a00441efc058a20a9b01927ed4c9c8b04e8432ec6354542e865e7ef51eb58943f4f",
|
|
7188
|
+
"createdAt": 1788700481500,
|
|
7189
|
+
"profile": {},
|
|
7190
|
+
"samples": [],
|
|
7191
|
+
"records": [],
|
|
7192
|
+
"token": "b324086efd80191a091d8f306abc5c8f8fd1d5bb23562da7762fd40757e04be1",
|
|
7193
|
+
"tokenExpires": 1791292481500
|
|
7194
|
+
},
|
|
7195
|
+
{
|
|
7196
|
+
"username": "乙1458",
|
|
7197
|
+
"passHash": "scrypt$e2d24841db8661af0f17abb239bd5b24$0d42de4a634c4fcafb2671d5eda4ef749ba6392a120ff22a0109a8f696dcf67d17d2846567aae5955c3f2b9bb871e706fafd0b360692770b7c00e781cfcbbf6b",
|
|
7198
|
+
"createdAt": 1788700481545,
|
|
7199
|
+
"profile": {},
|
|
7200
|
+
"samples": [],
|
|
7201
|
+
"records": [],
|
|
7202
|
+
"token": "b265baa5e3bc02e2ac5b2ba382db571749c5e6318a8e2a903c3fa8039b26e94f",
|
|
7203
|
+
"tokenExpires": 1791292481545
|
|
7204
|
+
},
|
|
7205
|
+
{
|
|
7206
|
+
"username": "列删1582",
|
|
7207
|
+
"passHash": "scrypt$4b38e854130074c683ffcbf332b86054$8031e874a5a7ea5eac352a2858c443406f28b75545f210518d8dc4df8f87979f13fefc5552e523b8cf9ae34b1d5b4765b244b2c43b83106c1fd438b6eb7d5548",
|
|
7208
|
+
"createdAt": 1788700481619,
|
|
7209
|
+
"profile": {},
|
|
7210
|
+
"samples": [],
|
|
7211
|
+
"records": [],
|
|
7212
|
+
"token": "c9b82991e344d324e8886364842341ed7ad2ac75a2cfa5eb87f0ccb095ddaf4d",
|
|
7213
|
+
"tokenExpires": 1791292481619
|
|
7214
|
+
},
|
|
7215
|
+
{
|
|
7216
|
+
"username": "删乙1582",
|
|
7217
|
+
"passHash": "scrypt$4397e185e0140601e622de9399ebe4a5$61bbd6114411d8e56c976cfb4d098fcd5e98092fdeeda5e7a3b1bf20c39457b062b0db38f69426a0e17c74844a4501bc01e5b512b9749e11b5afda2e5835c351",
|
|
7218
|
+
"createdAt": 1788700481659,
|
|
7219
|
+
"profile": {},
|
|
7220
|
+
"samples": [],
|
|
7221
|
+
"records": [],
|
|
7222
|
+
"token": "d7ad56ff74504a0322af65e5eabb55ea21b78a3045f69d40b2e36f0b9395150b",
|
|
7223
|
+
"tokenExpires": 1791292481659
|
|
7014
7224
|
}
|
|
7015
7225
|
]
|
|
7016
7226
|
}
|
|
Binary file
|
|
@@ -61,6 +61,16 @@ function ziweiBrief(r: ZiweiResult): string {
|
|
|
61
61
|
palaceLines.push(PALACE_NAMES[i] + parts.join('|'));
|
|
62
62
|
}
|
|
63
63
|
L.push('【十二宫事实(解读六亲/宫位必须逐字引用,不得推算或编造)】' + palaceLines.join(';') + '。');
|
|
64
|
+
// 昼夜与有效亮度(修正反馈:太阳喜昼、太阴喜夜——AI 论日月亮度须用有效值)
|
|
65
|
+
if (r.dayNight) L.push('【昼夜】' + (r.dayNight === 'day' ? '昼生(太阳得时、太阴减力)' : '夜生(太阴得时、太阳减力)') + '——论太阳/太阴亮度以【有效亮度】为准。');
|
|
66
|
+
if (r.effBrightness) L.push('【有效亮度(昼夜调整后)】' + Object.entries(r.effBrightness).map(([s, b]) => s + b).join('、') + '。');
|
|
67
|
+
// 空宫借对宫(修正反馈:空宫须借对宫看,勿论作真空)
|
|
68
|
+
if (r.borrowedStars) {
|
|
69
|
+
const PALACE2 = ['命', '兄弟', '夫妻', '子女', '财帛', '疾厄', '迁移', '交友', '官禄', '田宅', '福德', '父母'];
|
|
70
|
+
const bl = Object.entries(r.borrowedStars).filter(([, v]) => v.length > 0)
|
|
71
|
+
.map(([k, v]) => PALACE2[+k] + '宫空借对宫' + [...new Set(v)].join('、')).join(';');
|
|
72
|
+
if (bl) L.push('【空宫借星(空宫须借对宫主星论之,非真空)】' + bl + '。');
|
|
73
|
+
}
|
|
64
74
|
if (r.geju?.length) L.push('【格局】' + r.geju.map(g => g.name + '(' + g.ji + ')').join('、') + '。');
|
|
65
75
|
if (r.dayun?.length) L.push('【大限】当前第' + ((r.curDayunIdx ?? 0) + 1) + '大限(' + r.dayun[r.curDayunIdx ?? 0].start + '-' + r.dayun[r.curDayunIdx ?? 0].end + '岁,行至' + DIZHI[r.dayun[r.curDayunIdx ?? 0].palaceIdx] + '宫)。');
|
|
66
76
|
L.push('【流年】' + (r.nominalAge ?? '') + '虚岁流年命宫落' + (r.liunianPalaceName || '') + '(' + DIZHI[r.liunianIdx ?? 0] + '),主星' + (r.liunianStars?.join('、') || '未临') + '。');
|
|
@@ -86,6 +86,10 @@ export const ZW_GEJU: Record<string, GejuDef> = {
|
|
|
86
86
|
日月同宫: { name: '日月同宫', ji: '吉', desc: '太阳、太阴同守丑、未宫。日月并明,阴阳调和,主贵而富,但丑未为陷地,须看庙陷定论。' },
|
|
87
87
|
日月反背: { name: '日月反背', ji: '凶', desc: '太阳、太阴皆落陷(如太阳子丑、太阴巳午未),阴阳失序,主劳碌奔波、与父母缘分淡。' },
|
|
88
88
|
月朗天门: { name: '月朗天门', ji: '吉', desc: '太阴独坐亥宫庙旺。月照天门,清贵之象,主聪明秀气,名利双收。' },
|
|
89
|
+
水澄桂萼: { name: '水澄桂萼', ji: '吉', desc: '太阴独坐子宫庙旺。水清月明之格,主清雅聪慧、气质温婉,才华内秀,多出文艺气质。' },
|
|
90
|
+
明珠出海: { name: '明珠出海', ji: '吉', desc: '太阴在未宫独坐庙旺(未为月之财库),夜生人尤佳。主才华出众,名扬四海。' },
|
|
91
|
+
日月并明: { name: '日月并明', ji: '吉', desc: '太阳居卯辰巳(庙旺)与太阴居酉戌亥(庙旺)呼应,昼生太阳得地、夜生太阴得地者尤佳。主贵显。' },
|
|
92
|
+
日照雷门: { name: '日照雷门', ji: '吉', desc: '太阳卯宫坐命(卯为雷门),昼生人尤佳。主光明磊落,少年得志。' },
|
|
89
93
|
火贪格: { name: '火贪格', ji: '平', desc: '火星与贪狼同宫或三合。暴发之格,财富来得快、去得也快,宜见好就收。' },
|
|
90
94
|
铃贪格: { name: '铃贪格', ji: '平', desc: '铃星与贪狼同宫或三合。横发之格,突发机遇获利,成败皆烈。' },
|
|
91
95
|
石中隐玉: { name: '石中隐玉', ji: '吉', desc: '巨门坐子、午宫(尤以辛年生人)。口才出众,才华内敛,大器晚成。' },
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { NAYIN, ganZhiIndex, mod } from '../data/ganzhi';
|
|
3
3
|
import { GAN } from '../data/ganzhi';
|
|
4
4
|
import { trueSolarTime } from './trueSolarTime';
|
|
5
|
+
import { daysSince } from './calendar';
|
|
5
6
|
import type { ZiweiInput, ZiweiResult } from '../types';
|
|
6
7
|
|
|
7
8
|
import { PALACE_NAMES, ZW_SIHUA, ZW_BRIGHTNESS, LU_CUN, KUI_YUE, TIAN_MA, HUO_START, LING_START, ZW_GEJU } from '../data/ziwei';
|
|
@@ -124,6 +125,21 @@ export function ziweiCalc(input: ZiweiInput): ZiweiResult {
|
|
|
124
125
|
fuStars['天哭'] = mod(yearZhiIdx + 6, 12); // 午起子年顺行
|
|
125
126
|
fuStars['天虚'] = mod(fuStars['天哭'] + 6, 12);
|
|
126
127
|
|
|
128
|
+
/* 1.6 杂曜(修正反馈:辅星/杂曜覆盖有限,2026-09-05 补常用)
|
|
129
|
+
三台/八座:日支起子时顺/逆数至生时(日支由公历日期推,同八字历元) */
|
|
130
|
+
const dayZhiIdx = input.solarDate
|
|
131
|
+
? mod(daysSince(input.solarDate[0], input.solarDate[1], input.solarDate[2]) + 55, 60) % 12
|
|
132
|
+
: 0;
|
|
133
|
+
fuStars['三台'] = mod(dayZhiIdx + correctedHour, 12);
|
|
134
|
+
fuStars['八座'] = mod(dayZhiIdx - correctedHour, 12);
|
|
135
|
+
// 天才/天寿(年干禄存、年支起法)
|
|
136
|
+
const luIdx2 = LU_CUN[gan] ? zhiIdx(LU_CUN[gan]) : 0;
|
|
137
|
+
fuStars['天才'] = mod(luIdx2 + correctedHour, 12);
|
|
138
|
+
fuStars['天寿'] = mod(yearZhiIdx + 5, 12); // 子年起未宫顺行(近似,无古籍精确法时按口诀)
|
|
139
|
+
// 恩光/天贵(年干禄存宫起,恩光顺行、天贵逆行)
|
|
140
|
+
fuStars['恩光'] = mod(luIdx2 + correctedHour, 12);
|
|
141
|
+
fuStars['天贵'] = mod(luIdx2 + 6 - correctedHour, 12);
|
|
142
|
+
|
|
127
143
|
/* 2. 生年四化 */
|
|
128
144
|
const sh = ZW_SIHUA[gan] || { lu: '', quan: '', ke: '', ji: '' };
|
|
129
145
|
const sihua = { lu: sh.lu, quan: sh.quan, ke: sh.ke, ji: sh.ji };
|
|
@@ -140,6 +156,19 @@ export function ziweiCalc(input: ZiweiInput): ZiweiResult {
|
|
|
140
156
|
brightness[s] = (ZW_BRIGHTNESS[s] || [])[pos] || '平';
|
|
141
157
|
});
|
|
142
158
|
|
|
159
|
+
/* 3.1 昼夜调整(修正反馈:太阳喜昼、太阴喜夜,brightness 只按宫位未计生时昼夜)
|
|
160
|
+
规则:昼生(卯~申时支 2..7)太阳+1 级、太阴-1 级;夜生反之;庙/陷为界不越 */
|
|
161
|
+
const LV: Record<string, number> = { 陷: 1, 平: 2, 利: 3, 得: 4, 旺: 5, 庙: 6 };
|
|
162
|
+
const LV_NAME = ['', '陷', '平', '利', '得', '旺', '庙'];
|
|
163
|
+
const dayNight: 'day' | 'night' = correctedHour >= 2 && correctedHour <= 7 ? 'day' : 'night';
|
|
164
|
+
const effBrightness: Record<string, string> = {};
|
|
165
|
+
for (const s of Object.keys(brightness)) {
|
|
166
|
+
let lv = LV[brightness[s]] || 2;
|
|
167
|
+
if (s === '太阳') lv += dayNight === 'day' ? 1 : -1;
|
|
168
|
+
if (s === '太阴') lv += dayNight === 'night' ? 1 : -1;
|
|
169
|
+
effBrightness[s] = LV_NAME[Math.max(1, Math.min(6, lv))];
|
|
170
|
+
}
|
|
171
|
+
|
|
143
172
|
/* 4. 格局识别 */
|
|
144
173
|
const geju: ZiweiResult['geju'] = [];
|
|
145
174
|
const pushGeju = (key: string, why: string) => {
|
|
@@ -191,6 +220,30 @@ export function ziweiCalc(input: ZiweiInput): ZiweiResult {
|
|
|
191
220
|
if (zwStars['廉贞'] === zwStars['七杀']) pushGeju('廉贞七杀', '廉贞七杀同守 ' + DIZHI[zwStars['廉贞']] + ' 宫');
|
|
192
221
|
// 命无正曜
|
|
193
222
|
if (mingStars.length === 0) pushGeju('命无正曜', '命宫无十四主星,借对宫 ' + [...new Set(duiStars)].join('、') + ' 为用');
|
|
223
|
+
// 水澄桂萼:太阴在子庙且坐命/命三方(传统格须太阴得地于命局关键位)
|
|
224
|
+
const moonPos = zwStars['太阴'];
|
|
225
|
+
const moonInKey = moonPos !== undefined && (moonPos === ming || sanhe.includes(moonPos));
|
|
226
|
+
if (moonInKey && effBrightness['太阴'] === '庙' && DIZHI[moonPos] === '子') pushGeju('水澄桂萼', '太阴' + DIZHI[moonPos] + '宫庙旺' + (moonPos === ming ? '坐命' : '照命三方'));
|
|
227
|
+
// 明珠出海:太阴在未(位置 5)庙(同上:坐命/三方)
|
|
228
|
+
if (moonInKey && effBrightness['太阴'] === '庙' && DIZHI[moonPos] === '未') pushGeju('明珠出海', '太阴' + DIZHI[moonPos] + '宫庙旺' + (moonPos === ming ? '坐命' : '照命三方'));
|
|
229
|
+
// 日照雷门:太阳在卯(位置 1)庙旺 + 昼生
|
|
230
|
+
const sunPos = zwStars['太阳'];
|
|
231
|
+
if (sunPos !== undefined && DIZHI[sunPos] === '卯' && effBrightness['太阳'] !== '陷' && effBrightness['太阳'] !== '平') pushGeju('日照雷门', '太阳坐卯宫' + effBrightness['太阳'] + ',' + (dayNight === 'day' ? '昼生' : '夜生') + '人');
|
|
232
|
+
// 日月并明:太阳庙旺于卯辰巳 且 太阴庙旺于酉戌亥
|
|
233
|
+
const sunGood = sunPos !== undefined && ['卯', '辰', '巳'].includes(DIZHI[sunPos]) && effBrightness['太阳'] !== '陷' && effBrightness['太阳'] !== '平';
|
|
234
|
+
const moonGood = moonPos !== undefined && ['酉', '戌', '亥'].includes(DIZHI[moonPos]) && effBrightness['太阴'] !== '陷' && effBrightness['太阴'] !== '平';
|
|
235
|
+
if (sunGood && moonGood) pushGeju('日月并明', '太阳' + DIZHI[sunPos] + effBrightness['太阳'] + '、太阴' + DIZHI[moonPos] + effBrightness['太阴'] + '皆得地');
|
|
236
|
+
|
|
237
|
+
/* 4.1 空宫借对宫(修正反馈:空宫须借对宫主星看)——十二宫逐一输出所借主星 */
|
|
238
|
+
const borrowedStars: Record<number, string[]> = {};
|
|
239
|
+
for (let i = 0; i < 12; i++) {
|
|
240
|
+
const p = palaces[i];
|
|
241
|
+
const own = Object.keys(zwStars).filter(s => zwStars[s] === p);
|
|
242
|
+
if (own.length === 0) {
|
|
243
|
+
const opp = mod(p + 6, 12);
|
|
244
|
+
borrowedStars[i] = Object.keys(zwStars).filter(s => zwStars[s] === opp);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
194
247
|
|
|
195
248
|
/* ===== 大限与流年(原逻辑保留) ===== */
|
|
196
249
|
const JU_AGE: Record<string, number> = { 二: 2, 三: 3, 四: 4, 五: 5, 六: 6 };
|
|
@@ -214,5 +267,5 @@ export function ziweiCalc(input: ZiweiInput): ZiweiResult {
|
|
|
214
267
|
const liunianPalaceName = PALACE_NAMES[Object.keys(palaces).find(k => palaces[Number(k)] === liunianIdx) ? Number(Object.keys(palaces).find(k => palaces[Number(k)] === liunianIdx)) : 0];
|
|
215
268
|
const liunianStars = Object.keys(zwStars).filter(s => zwStars[s] === liunianIdx);
|
|
216
269
|
|
|
217
|
-
return { ming, shen, zwPos, zwStars, fuStars, palaces, juName, mingGZ, nayin, correctedHour, dayun, curDayunIdx, nominalAge, liunianIdx, liunianPalaceName, liunianStars, startAge, forward, sihua, sihuaPos, brightness, geju };
|
|
270
|
+
return { ming, shen, zwPos, zwStars, fuStars, palaces, juName, mingGZ, nayin, correctedHour, dayun, curDayunIdx, nominalAge, liunianIdx, liunianPalaceName, liunianStars, startAge, forward, sihua, sihuaPos, brightness, geju, dayNight, effBrightness, borrowedStars };
|
|
218
271
|
}
|
package/shared/core/types.ts
CHANGED
|
@@ -89,6 +89,10 @@ export interface ZiweiResult {
|
|
|
89
89
|
sihuaPos: { lu?: number; quan?: number; ke?: number; ji?: number }; // 四化落宫位
|
|
90
90
|
brightness: Record<string, string>; // 十四主星亮度('庙'|'旺'|'得'|'利'|'平'|'陷')
|
|
91
91
|
geju: { key: string; name: string; ji: '吉' | '凶' | '平'; desc: string; why: string }[]; // 格局
|
|
92
|
+
// ─── 修正层(2026-09-05 算法边界反馈)───
|
|
93
|
+
dayNight?: 'day' | 'night'; // 昼生/夜生(按生时:卯~申为昼,酉~寅为夜)
|
|
94
|
+
effBrightness?: Record<string, string>; // 昼夜调整后有效亮度(太阳喜昼、太阴喜夜)
|
|
95
|
+
borrowedStars?: Record<number, string[]>; // 空宫借对宫主星(十二宫位 → 所借主星)
|
|
92
96
|
}
|
|
93
97
|
|
|
94
98
|
// 奇门输入输出
|