File tree 4 files changed +7
-4
lines changed
4 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -8,4 +8,7 @@ VITE_OPEN = false
8
8
VITE_OPEN_CDN = false
9
9
10
10
# public path 配置线上环境路径(打包)、本地通过 http-server 访问时,请置空即可
11
- VITE_PUBLIC_PATH =
11
+ VITE_PUBLIC_PATH =
12
+
13
+ # SM公钥
14
+ VITE_SM_PUBLIC_KEY = " 0484C7466D950E120E5ECE5DD85D0C90EAA85081A3A2BD7C57AE6DC822EFCCBD66620C67B0103FC8DD280E36C3B282977B722AAEC3C56518EDCEBAFB72C5A05312"
Original file line number Diff line number Diff line change @@ -195,7 +195,7 @@ const onLockScreenSubmit = async () => {
195
195
try {
196
196
// SM2加密密码
197
197
// const keys = SM2.generateKeyPair();
198
- const publicKey = ` 0484C7466D950E120E5ECE5DD85D0C90EAA85081A3A2BD7C57AE6DC822EFCCBD66620C67B0103FC8DD280E36C3B282977B722AAEC3C56518EDCEBAFB72C5A05312 ` ;
198
+ const publicKey = window . __env__ . VITE_SM_PUBLIC_KEY ;
199
199
const password = sm2 .doEncrypt (state .lockScreenPassword , publicKey , 1 );
200
200
const [err, res] = await feature (getAPI (SysAuthApi ).apiSysAuthUnLockScreenPost (password ));
201
201
if (err ) {
Original file line number Diff line number Diff line change @@ -160,7 +160,7 @@ const onSignIn = async () => {
160
160
161
161
// SM2加密密码
162
162
// const keys = SM2.generateKeyPair();
163
- const publicKey = ` 0484C7466D950E120E5ECE5DD85D0C90EAA85081A3A2BD7C57AE6DC822EFCCBD66620C67B0103FC8DD280E36C3B282977B722AAEC3C56518EDCEBAFB72C5A05312 ` ;
163
+ const publicKey = window . __env__ . VITE_SM_PUBLIC_KEY ;
164
164
const password = sm2 .doEncrypt (state .ruleForm .password , publicKey , 1 );
165
165
166
166
const [err, res] = await feature (getAPI (SysAuthApi ).apiSysAuthLoginPost ({ ... state .ruleForm , password: password }));
Original file line number Diff line number Diff line change @@ -293,7 +293,7 @@ const submitPassword = () => {
293
293
294
294
// SM2加密密码
295
295
const cpwd: ChangePwdInput = { passwordOld: ' ' , passwordNew: ' ' };
296
- const publicKey = ` 0484C7466D950E120E5ECE5DD85D0C90EAA85081A3A2BD7C57AE6DC822EFCCBD66620C67B0103FC8DD280E36C3B282977B722AAEC3C56518EDCEBAFB72C5A05312 ` ;
296
+ const publicKey = window . __env__ . VITE_SM_PUBLIC_KEY ;
297
297
cpwd .passwordOld = sm2 .doEncrypt (state .ruleFormPassword .passwordOld , publicKey , 1 );
298
298
cpwd .passwordNew = sm2 .doEncrypt (state .ruleFormPassword .passwordNew , publicKey , 1 );
299
299
await getAPI (SysUserApi ).apiSysUserChangePwdPost (cpwd );
You can’t perform that action at this time.
0 commit comments