package strategy; /** * Copyright (c) 2021, ustchcs and its affiliates. All rights reserved. More info see www.ustchcs.com * * @author cch * @package Thymeleaf1 com.example.demo.design.strategy * @node */ public class StrategyDesign { public static void main(String[] args) { WechatStrategy wechatStrategy = new WechatStrategy(); CustomAuthenticator customAuthenticator = new CustomAuthenticator(wechatStrategy); customAuthenticator.authenticate("cch", "1234556"); customAuthenticator.setStrategy(new LocalStrategy()); customAuthenticator.authenticate("cch2", "12345567"); } }