728x90 반응형 분류 전체보기217 비밀번호 단방향암호화(SHA256) 하기 : Fiber v2.x 놀자코딩#Programming #Coding #Development #API #Server #python #golang #java #nodejs #javascript #프로그래밍 #코딩 #개발 #서버 #파이썬 #Go언어 #자바 #노드 #자바스크립트www.youtube.com 여기에서는 비밀번호의 단방향 암호화를 구현해보도록 하겠습니다. SHA256을 적용하겠습니다. Fiber에서는 아무런 작업을 하지 않고, DB(MySQL)에서만 작업을 하겠습니다. 1. 일단 DBMS에 접속해봅니다.$ mysql -u xyz -pxyz123 xyzmysql: [Warning] Using a password on the command line interface can be insecure.Reading table inf.. 2021. 10. 1. 로그인/로그아웃 처리하기 : Fiber v2.x 명색이 관리자 화면인데, 아무나 들어와서 조작하면 안되겠지요? 이제는 마지막으로 로그인/로그아웃 처리를 해보겠습니다. 로그인/로그아웃은 세션을 이용해서 구현합니다. 1. 로그인 화면을 구성합니다. ~/project/xyz/views/mgmt/index.html 을 작성합니다. 아이디 비밀번호 2. ~/project/xyz/controllers/mgmt/main.go 를 생성합니다. package mgmt // controllers/mgmt import ( "github.com/gofiber/fiber/v2" ) // MGMT Login 화면 func Index(c *fiber.Ctx) error { return c.Render("mgmt/index", fiber.Map{}) } 3. ~/project/x.. 2021. 10. 1. 관리자 삭제하기 : Fiber v2.x 1. 관리자 삭제를 위한 저장 프로시저(deleteAdmin)을 만들어봅시다. $ mysql -u xyz -pxyz123 xyz mysql: [Warning] Using a password on the command line interface can be insecure. Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 271 Server version: 8.0.26-0ub.. 2021. 10. 1. 관리자 수정하기 : Fiber v2.x 1. ~/project/xyz/views/mgmt/admin/update_form.html 을 작성한다. × 관리자 수정 아이디 별명 (필수) 2. ~/project/xyz/controllers/mgmt/admin.go 에 다음을 추가한다. ... // 관리자 수정 폼 // /mgnt/admin/update_form/{id} func UpdateForm (c *fiber.Ctx) error { type Admin struct { Sno int Userid string Passwd string Nick string } var admin Admin id := c.Params("id") db := database.DBConn db.Raw("CALL getAdmin(?)", id).First(&admin) da.. 2021. 10. 1. 관리자 비밀번호 변경하기 : Fiber v2.x 이번에는 관리자의 비밀번호를 변경해볼 것입니다. 이를 위해서 저장프로시저를 2개 생성할 것이고, 관련 코드들을 작성해보겠습니다. 코드들이 이전과 비슷하지만, 조금씩 다들 부분들이 있으니 주의해서 봐주세요. 그리고, 이 튜토리얼의 소스는 https://github.com/gauryan/fiber-tutorial에서도 확인할 수 있습니다. 1. 저장 프로시저 (getAdmin) 생성 $ mysql -u xyz -pxyz123 xyz mysql: [Warning] Using a password on the command line interface can be insecure. Reading table information for completion of table and column names You can .. 2021. 9. 29. 관리자 추가하기 : Fiber v2.x 이 튜토리얼의 소스는 https://github.com/gauryan/fiber-tutorial 에서도 확인할 수 있습니다. 관리자 목록을 보았으니, 이제는 새로운 관리자를 추가해봅시다. 1. 저장 프로시저 (insertAdmin) 생성 $ mysql -u xyz -pxyz123 xyz mysql: [Warning] Using a password on the command line interface can be insecure. Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monit.. 2021. 9. 28. 이전 1 ··· 8 9 10 11 12 13 14 ··· 37 다음 728x90 반응형