mirror of
				https://github.com/whyour/qinglong.git
				synced 2025-11-04 11:16:07 +08:00 
			
		
		
		
	修复开启两步失败提醒
This commit is contained in:
		
							parent
							
								
									1265e465d0
								
							
						
					
					
						commit
						bf43bfbd92
					
				| 
						 | 
					@ -55,6 +55,7 @@ const SecuritySettings = ({ user, userChange }: any) => {
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const completeTowFactor = () => {
 | 
					  const completeTowFactor = () => {
 | 
				
			||||||
 | 
					    setLoading(true);
 | 
				
			||||||
    request
 | 
					    request
 | 
				
			||||||
      .put(`${config.apiPrefix}user/two-factor/active`, { data: { code } })
 | 
					      .put(`${config.apiPrefix}user/two-factor/active`, { data: { code } })
 | 
				
			||||||
      .then((data: any) => {
 | 
					      .then((data: any) => {
 | 
				
			||||||
| 
						 | 
					@ -63,11 +64,14 @@ const SecuritySettings = ({ user, userChange }: any) => {
 | 
				
			||||||
          setTwoFactoring(false);
 | 
					          setTwoFactoring(false);
 | 
				
			||||||
          setTwoFactorActived(true);
 | 
					          setTwoFactorActived(true);
 | 
				
			||||||
          userChange();
 | 
					          userChange();
 | 
				
			||||||
 | 
					        } else {
 | 
				
			||||||
 | 
					          message.success('验证失败');
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      })
 | 
					      })
 | 
				
			||||||
      .catch((error: any) => {
 | 
					      .catch((error: any) => {
 | 
				
			||||||
        console.log(error);
 | 
					        console.log(error);
 | 
				
			||||||
      });
 | 
					      })
 | 
				
			||||||
 | 
					      .finally(() => setLoading(false));
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const getTwoFactorInfo = () => {
 | 
					  const getTwoFactorInfo = () => {
 | 
				
			||||||
| 
						 | 
					@ -132,7 +136,7 @@ const SecuritySettings = ({ user, userChange }: any) => {
 | 
				
			||||||
            onChange={(e) => setCode(e.target.value)}
 | 
					            onChange={(e) => setCode(e.target.value)}
 | 
				
			||||||
            placeholder="123456"
 | 
					            placeholder="123456"
 | 
				
			||||||
          />
 | 
					          />
 | 
				
			||||||
          <Button type="primary" onClick={completeTowFactor}>
 | 
					          <Button type="primary" loading={loading} onClick={completeTowFactor}>
 | 
				
			||||||
            完成设置
 | 
					            完成设置
 | 
				
			||||||
          </Button>
 | 
					          </Button>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user