Commit eb6e91de by 苗权威

7.20

parent 9ad36030
......@@ -29,7 +29,7 @@
<module name="open" options="-parameters" />
<module name="rokid" options="-parameters" />
<module name="ruoqi" options="-parameters" />
<module name="spirit" options="-parameters -extdirs $PROJECT_DIR$/spirit/src/main/resources/lib" />
<module name="spirit" options="-parameters -extdirs /usr/local/intellij/workplace/smartbox/spirit/src/main/resources/lib" />
<module name="third_party_load" options="-parameters" />
<module name="xiaoai" options="-parameters" />
<module name="xiaodu" options="-parameters" />
......
......@@ -2,5 +2,6 @@
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="Duplicates" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="ThymeleafVariablesResolveInspection" enabled="true" level="WARNING" enabled_by_default="true" />
</profile>
</component>
\ No newline at end of file
......@@ -3,22 +3,23 @@
<component name="ChangeListManager">
<list default="true" id="4a2f3afc-3cd8-46bb-9e78-9759246c43dc" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/compiler.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/compiler.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/encodings.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/encodings.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/inspectionProfiles/Project_Default.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/inspectionProfiles/Project_Default.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/dingdong/src/main/java/ai/qiwu/dong/dingdong/controller/DingDongController.java" beforeDir="false" afterPath="$PROJECT_DIR$/dingdong/src/main/java/ai/qiwu/dong/dingdong/controller/DingDongController.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/dingdong/src/main/java/ai/qiwu/dong/dingdong/service/ParseService.java" beforeDir="false" afterPath="$PROJECT_DIR$/dingdong/src/main/java/ai/qiwu/dong/dingdong/service/ParseService.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/dingdong/src/main/java/ai/qiwu/dong/dingdong/service/ParseServiceCompromise.java" beforeDir="false" afterPath="$PROJECT_DIR$/dingdong/src/main/java/ai/qiwu/dong/dingdong/service/ParseServiceCompromise.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/jdwhale/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/jdwhale/pom.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/jdwhale/src/main/java/ai/qiwu/mqw/jdwhale/common/Constants.java" beforeDir="false" afterPath="$PROJECT_DIR$/jdwhale/src/main/java/ai/qiwu/mqw/jdwhale/common/Constants.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/jdwhale/src/main/java/ai/qiwu/mqw/jdwhale/controller/DingDongController.java" beforeDir="false" afterPath="$PROJECT_DIR$/jdwhale/src/main/java/ai/qiwu/mqw/jdwhale/controller/DingDongController.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/jdwhale/src/main/java/ai/qiwu/mqw/jdwhale/service/ParseServiceWithoutLRU.java" beforeDir="false" afterPath="$PROJECT_DIR$/jdwhale/src/main/java/ai/qiwu/mqw/jdwhale/service/ParseServiceWithoutLRU.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/third_party_load/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/third_party_load/pom.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/third_party_load/src/main/java/ai/qiwu/com/third_party_load/ThirdPartyLoadApplication.java" beforeDir="false" afterPath="$PROJECT_DIR$/third_party_load/src/main/java/ai/qiwu/com/third_party_load/ThirdPartyLoadApplication.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/third_party_load/src/main/java/ai/qiwu/com/third_party_load/pojo/User.java" beforeDir="false" afterPath="$PROJECT_DIR$/third_party_load/src/main/java/ai/qiwu/com/third_party_load/pojo/UserProfile.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/third_party_load/src/main/resources/application.properties" beforeDir="false" afterPath="$PROJECT_DIR$/third_party_load/src/main/resources/application.yml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/xiaodu/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/xiaodu/pom.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/XiaoduApplication.java" beforeDir="false" afterPath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/XiaoduApplication.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/common/Constants.java" beforeDir="false" afterPath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/common/Constants.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/common/Utils.java" beforeDir="false" afterPath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/common/Utils.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/controller/XiaoDuController.java" beforeDir="false" afterPath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/controller/XiaoDuController.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/User.java" beforeDir="false" afterPath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/User.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/product/Product.java" beforeDir="false" afterPath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/product/Product.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/product/ProductEnumItem.java" beforeDir="false" afterPath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/product/ProductEnumItem.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/product/PublishingInformation.java" beforeDir="false" afterPath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/product/PublishingInformation.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/service/ResponseEncapsulation.java" beforeDir="false" afterPath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/service/ResponseEncapsulation.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/xiaodu/src/main/resources/application.properties" beforeDir="false" afterPath="$PROJECT_DIR$/xiaodu/src/main/resources/application.properties" afterDir="false" />
<change beforePath="$PROJECT_DIR$/xiaoya/src/main/resources/application.properties" beforeDir="false" afterPath="$PROJECT_DIR$/xiaoya/src/main/resources/application.properties" afterDir="false" />
</list>
<ignored path="$PROJECT_DIR$/out/" />
<ignored path="$PROJECT_DIR$/target/" />
......@@ -59,78 +60,55 @@
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/xiaodu/pom.xml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-198">
<caret line="30" column="25" selection-start-line="30" selection-start-column="25" selection-end-line="30" selection-end-column="25" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/xiaoai/pom.xml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="726">
<caret line="63" column="19" selection-start-line="63" selection-start-column="19" selection-end-line="63" selection-end-column="19" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/service/ResponseEncapsulation.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="587">
<caret line="316" column="19" lean-forward="true" selection-start-line="316" selection-start-column="19" selection-end-line="316" selection-end-column="19" />
<state relative-caret-position="477">
<caret line="351" column="5" lean-forward="true" selection-start-line="351" selection-start-column="5" selection-end-line="351" selection-end-column="5" />
<folding>
<element signature="e#4597#4650#0" />
<element signature="e#6944#6959#0" />
<element signature="e#6035#6088#0" />
<element signature="e#10040#10055#0" />
<element signature="e#13141#13206#0" />
<element signature="e#13537#13549#0" />
<element signature="e#17062#17118#0" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/baidu/dueros/bot-sdk/1.2.0/bot-sdk-1.2.0.jar!/com/baidu/dueros/data/response/directive/pay/Buy.class">
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/controller/Oauth2Controller.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="814">
<caret line="50" column="15" selection-start-line="50" selection-start-column="15" selection-end-line="50" selection-end-column="15" />
<state relative-caret-position="961">
<caret line="143" column="24" lean-forward="true" selection-start-line="143" selection-start-column="24" selection-end-line="143" selection-end-column="24" />
<folding>
<element signature="e#1245#1246#0" expanded="true" />
<element signature="e#1295#1296#0" expanded="true" />
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/product/Product.java">
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/service/LoadBySMS.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="374">
<caret line="17" lean-forward="true" selection-start-line="17" selection-end-line="17" />
<state relative-caret-position="266">
<caret line="85" column="19" selection-start-line="85" selection-start-column="19" selection-end-line="85" selection-end-column="19" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#1007#1016#0" />
<element signature="e#1792#1825#0" />
<element signature="e#4529#4548#0" />
<element signature="e#6636#6637#0" expanded="true" />
<element signature="e#6669#6670#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/product/ProductEnumItem.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="220">
<caret line="10" column="19" selection-start-line="10" selection-start-column="19" selection-end-line="10" selection-end-column="19" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/product/CustomProductPrompts.java">
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/resources/templates/Oauth2_load.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="286">
<caret line="13" column="41" selection-start-line="13" selection-start-column="41" selection-end-line="13" selection-end-column="41" />
<folding>
<element signature="imports" expanded="true" />
</folding>
<state relative-caret-position="484">
<caret line="28" column="36" lean-forward="true" selection-start-line="28" selection-start-column="36" selection-end-line="28" selection-end-column="36" />
</state>
</provider>
</entry>
......@@ -141,6 +119,8 @@
<option name="RECENT_TEMPLATES">
<list>
<option value="Enum" />
<option value="Interface" />
<option value="HTML File" />
<option value="Class" />
</list>
</option>
......@@ -163,57 +143,57 @@
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/open/src/main/java/ai/qiwu/com/open/common/error/project/DownloadFromTerminateFailed.java" />
<option value="$PROJECT_DIR$/open/src/main/java/ai/qiwu/com/open/pojo/response/Response.java" />
<option value="$PROJECT_DIR$/open/src/main/java/ai/qiwu/com/open/pojo/response/AudioResponse.java" />
<option value="$PROJECT_DIR$/open/src/main/java/ai/qiwu/com/open/pojo/response/TextResponse.java" />
<option value="$PROJECT_DIR$/open/src/main/java/ai/qiwu/com/open/common/error/project/ActiveGetTokenFailed.java" />
<option value="$PROJECT_DIR$/open/src/main/java/ai/qiwu/com/open/common/error/project/RequestTerminateFailed.java" />
<option value="$PROJECT_DIR$/open/src/main/java/ai/qiwu/com/open/common/error/project/UploadAudioFileFailed.java" />
<option value="$PROJECT_DIR$/open/src/main/java/ai/qiwu/com/open/pojo/ParseResponse.java" />
<option value="$PROJECT_DIR$/open/src/main/java/ai/qiwu/com/open/front/assembly/Root.java" />
<option value="$PROJECT_DIR$/open/src/main/java/ai/qiwu/com/open/front/assembly/Element.java" />
<option value="$PROJECT_DIR$/open/src/main/java/ai/qiwu/com/open/common/error/OpenError.java" />
<option value="$PROJECT_DIR$/open/src/main/java/ai/qiwu/com/open/common/error/project/ParseRequestXmlDataFailed.java" />
<option value="$PROJECT_DIR$/open/src/main/java/ai/qiwu/com/open/common/utils/MessageUtil.java" />
<option value="$PROJECT_DIR$/open/src/main/java/ai/qiwu/com/open/common/utils/UpDownloadAudion.java" />
<option value="$PROJECT_DIR$/open/src/main/java/ai/qiwu/com/open/controller/OpenController.java" />
<option value="$PROJECT_DIR$/open/src/main/java/ai/qiwu/com/open/pojo/qiwu/QiWuRequest.java" />
<option value="$PROJECT_DIR$/spirit/src/main/java/ai/qiwu/tmall/spirit/controller/SpiritController.java" />
<option value="$PROJECT_DIR$/jdwhale/pom.xml" />
<option value="$PROJECT_DIR$/spirit/pom.xml" />
<option value="$PROJECT_DIR$/open/src/main/java/ai/qiwu/com/open/pojo/UserCacheHolder.java" />
<option value="$PROJECT_DIR$/open/src/main/java/ai/qiwu/com/open/pojo/qiwu/QiWuResponse.java" />
<option value="$PROJECT_DIR$/open/src/main/java/ai/qiwu/com/open/service/ParseRequest.java" />
<option value="$PROJECT_DIR$/open/src/main/java/ai/qiwu/com/open/service/RequestQiWu.java" />
<option value="$PROJECT_DIR$/open/src/main/java/ai/qiwu/com/open/front/RefreshView.java" />
<option value="$PROJECT_DIR$/open/src/main/java/ai/qiwu/com/open/common/OpenConstants.java" />
<option value="$PROJECT_DIR$/open/src/main/java/ai/qiwu/com/open/common/utils/BuildRequestResponse.java" />
<option value="$PROJECT_DIR$/open/src/main/java/ai/qiwu/com/open/common/utils/Schedule.java" />
<option value="$PROJECT_DIR$/open/src/main/java/ai/qiwu/com/open/pojo/AccessToken.java" />
<option value="$PROJECT_DIR$/open/src/test/java/ai/qiwu/com/open/common/encryption/WXBizMsgCryptTest.java" />
<option value="$PROJECT_DIR$/open/src/main/java/ai/qiwu/com/open/service/OpenService.java" />
<option value="$PROJECT_DIR$/dingdong/src/main/java/ai/qiwu/dong/dingdong/controller/DingDongController.java" />
<option value="$PROJECT_DIR$/dingdong/src/main/java/ai/qiwu/dong/dingdong/service/ParseService.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/controller/XiaoDuController.java" />
<option value="$PROJECT_DIR$/third_party_load/src/main/java/ai/qiwu/com/third_party_load/ThirdPartyLoadApplication.java" />
<option value="$PROJECT_DIR$/third_party_load/src/main/java/ai/qiwu/com/third_party_load/properties/OAuth2Properties.java" />
<option value="$PROJECT_DIR$/third_party_load/src/main/java/ai/qiwu/com/third_party_load/config/AuthorizationServerConfig.java" />
<option value="$PROJECT_DIR$/third_party_load/src/main/java/ai/qiwu/com/third_party_load/config/SecurityConfig.java" />
<option value="$PROJECT_DIR$/third_party_load/src/main/java/ai/qiwu/com/third_party_load/config/SecurityCoreConfig.java" />
<option value="$PROJECT_DIR$/third_party_load/src/main/java/ai/qiwu/com/third_party_load/properties/LoginType.java" />
<option value="$PROJECT_DIR$/third_party_load/src/main/java/ai/qiwu/com/third_party_load/browser/handler/BrowserAuthenticationSuccessHandler.java" />
<option value="$PROJECT_DIR$/third_party_load/pom.xml" />
<option value="$PROJECT_DIR$/third_party_load/src/main/java/ai/qiwu/com/third_party_load/properties/SecurityConstants.java" />
<option value="$PROJECT_DIR$/third_party_load/src/main/java/ai/qiwu/com/third_party_load/config/AbstractChannelSecurityConfig.java" />
<option value="$PROJECT_DIR$/third_party_load/src/main/java/ai/qiwu/com/third_party_load/properties/BrowserSecurityConfig.java" />
<option value="$PROJECT_DIR$/third_party_load/src/main/java/ai/qiwu/com/third_party_load/properties/BrowserProperties.java" />
<option value="$PROJECT_DIR$/third_party_load/src/main/java/ai/qiwu/com/third_party_load/properties/SecurityProperties.java" />
<option value="$PROJECT_DIR$/third_party_load/src/main/java/ai/qiwu/com/third_party_load/browser/handler/MqwAuthenticationSuccessHandler.java" />
<option value="$PROJECT_DIR$/third_party_load/src/main/java/ai/qiwu/com/third_party_load/pojo/SimpleResponse.java" />
<option value="$PROJECT_DIR$/third_party_load/src/main/java/ai/qiwu/com/third_party_load/controller/BrowserSecurityController.java" />
<option value="$PROJECT_DIR$/third_party_load/src/main/java/ai/qiwu/com/third_party_load/browser/handler/MqwAuthenticationFailureHandler.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/resources/application.properties" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/security/AuthenticationSuccessHandler.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/security/AuthorizationServer.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/security/ApoUserDetailService.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/resources/templates/loadBySMS.html" />
<option value="$PROJECT_DIR$/xiaodu/src/main/resources/templates/LoadFailed.html" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/CaptchaSmsResponse.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/TokenResponse.java" />
<option value="$PROJECT_DIR$/xiaodu/pom.xml" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/common/CollectionUtils.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/GetUserInfoByToken.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/GetTokenByRefreshToken.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/common/OkHttp3Utils.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/resources/templates/LoadBySMS.html" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/XiaoduApplication.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/oauth2/AuthorizationController.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/resources/templates/Security_Load.html" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/User.java" />
<option value="$PROJECT_DIR$/third_party_load/src/main/java/ai/qiwu/com/third_party_load/pojo/User.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/security/ApiUserDetailService.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/Product.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/AudioUrlAndText.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/product/CustomProductPrompts.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/product/PublishingInformation.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/product/Pricing.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/resources/templates/Oaurh2_load.html" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/TokenDuerosResponse.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/SecurityRequestParams.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/resources/templates/LoadSuccess.html" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/common/Constants.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/baiduLoad/BaiDuLoad.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/resources/templates/LoadBaiDu.html" />
<option value="$PROJECT_DIR$/xiaodu/src/main/resources/templates/Oauth2RedirectCode.html" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/common/TokenHolder.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/controller/XiaoDuController.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/service/ScheduleTask.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/controller/LoadFrontController.java" />
<option value="$PROJECT_DIR$/open/src/main/java/ai/qiwu/com/open/common/utils/HttpRequestUtils.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/common/HttpRequestUtils.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/resources/templates/Oauth2_load.html" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/common/Utils.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/service/ResponseEncapsulation.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/XiaoduApplication.java" />
<option value="$PROJECT_DIR$/xiaodu/pom.xml" />
<option value="$PROJECT_DIR$/third_party_load/pom.xml" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/product/Product.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/product/ProductEnumItem.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/service/LoadBySMS.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/controller/Oauth2Controller.java" />
</list>
</option>
</component>
......@@ -231,6 +211,20 @@
<expand>
<path>
<item name="" type="16c1761:MavenProjectsStructure$RootNode" />
<item name="third_party_load" type="9519ce18:MavenProjectsStructure$ProjectNode" />
</path>
<path>
<item name="" type="16c1761:MavenProjectsStructure$RootNode" />
<item name="third_party_load" type="9519ce18:MavenProjectsStructure$ProjectNode" />
<item name="Lifecycle" type="58874e2:MavenProjectsStructure$LifecycleNode" />
</path>
<path>
<item name="" type="16c1761:MavenProjectsStructure$RootNode" />
<item name="third_party_load" type="9519ce18:MavenProjectsStructure$ProjectNode" />
<item name="Dependencies" type="f4be9f2a:MavenProjectsStructure$DependenciesNode" />
</path>
<path>
<item name="" type="16c1761:MavenProjectsStructure$RootNode" />
<item name="xiaodu" type="9519ce18:MavenProjectsStructure$ProjectNode" />
</path>
<path>
......@@ -246,8 +240,8 @@
<option name="skipTests" value="true" />
</component>
<component name="ProjectFrameBounds">
<option name="x" value="544" />
<option name="y" value="82" />
<option name="x" value="454" />
<option name="y" value="64" />
<option name="width" value="1417" />
<option name="height" value="1004" />
</component>
......@@ -259,6 +253,8 @@
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="PackagesPane" />
<pane id="Scope" />
<pane id="ProjectPane">
<subPane>
<expand>
......@@ -304,6 +300,66 @@
<path>
<item name="smartbox" type="b2602c69:ProjectViewProjectNode" />
<item name="smartbox" type="462c0819:PsiDirectoryNode" />
<item name="third_party_load" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="main" type="462c0819:PsiDirectoryNode" />
<item name="java" type="462c0819:PsiDirectoryNode" />
<item name="third_party_load" type="462c0819:PsiDirectoryNode" />
<item name="handler" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="smartbox" type="b2602c69:ProjectViewProjectNode" />
<item name="smartbox" type="462c0819:PsiDirectoryNode" />
<item name="third_party_load" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="main" type="462c0819:PsiDirectoryNode" />
<item name="java" type="462c0819:PsiDirectoryNode" />
<item name="third_party_load" type="462c0819:PsiDirectoryNode" />
<item name="config" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="smartbox" type="b2602c69:ProjectViewProjectNode" />
<item name="smartbox" type="462c0819:PsiDirectoryNode" />
<item name="third_party_load" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="main" type="462c0819:PsiDirectoryNode" />
<item name="java" type="462c0819:PsiDirectoryNode" />
<item name="third_party_load" type="462c0819:PsiDirectoryNode" />
<item name="controller" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="smartbox" type="b2602c69:ProjectViewProjectNode" />
<item name="smartbox" type="462c0819:PsiDirectoryNode" />
<item name="third_party_load" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="main" type="462c0819:PsiDirectoryNode" />
<item name="java" type="462c0819:PsiDirectoryNode" />
<item name="third_party_load" type="462c0819:PsiDirectoryNode" />
<item name="pojo" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="smartbox" type="b2602c69:ProjectViewProjectNode" />
<item name="smartbox" type="462c0819:PsiDirectoryNode" />
<item name="third_party_load" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="main" type="462c0819:PsiDirectoryNode" />
<item name="java" type="462c0819:PsiDirectoryNode" />
<item name="third_party_load" type="462c0819:PsiDirectoryNode" />
<item name="properties" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="smartbox" type="b2602c69:ProjectViewProjectNode" />
<item name="smartbox" type="462c0819:PsiDirectoryNode" />
<item name="third_party_load" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="main" type="462c0819:PsiDirectoryNode" />
<item name="java" type="462c0819:PsiDirectoryNode" />
<item name="third_party_load" type="462c0819:PsiDirectoryNode" />
<item name="service" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="smartbox" type="b2602c69:ProjectViewProjectNode" />
<item name="smartbox" type="462c0819:PsiDirectoryNode" />
<item name="xiaodu" type="462c0819:PsiDirectoryNode" />
</path>
<path>
......@@ -344,7 +400,7 @@
<item name="main" type="462c0819:PsiDirectoryNode" />
<item name="java" type="462c0819:PsiDirectoryNode" />
<item name="xiaodu" type="462c0819:PsiDirectoryNode" />
<item name="pojo" type="462c0819:PsiDirectoryNode" />
<item name="baiduLoad" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="smartbox" type="b2602c69:ProjectViewProjectNode" />
......@@ -354,8 +410,7 @@
<item name="main" type="462c0819:PsiDirectoryNode" />
<item name="java" type="462c0819:PsiDirectoryNode" />
<item name="xiaodu" type="462c0819:PsiDirectoryNode" />
<item name="pojo" type="462c0819:PsiDirectoryNode" />
<item name="product" type="462c0819:PsiDirectoryNode" />
<item name="common" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="smartbox" type="b2602c69:ProjectViewProjectNode" />
......@@ -365,7 +420,7 @@
<item name="main" type="462c0819:PsiDirectoryNode" />
<item name="java" type="462c0819:PsiDirectoryNode" />
<item name="xiaodu" type="462c0819:PsiDirectoryNode" />
<item name="service" type="462c0819:PsiDirectoryNode" />
<item name="controller" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="smartbox" type="b2602c69:ProjectViewProjectNode" />
......@@ -373,60 +428,70 @@
<item name="xiaodu" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="main" type="462c0819:PsiDirectoryNode" />
<item name="resources" type="462c0819:PsiDirectoryNode" />
<item name="java" type="462c0819:PsiDirectoryNode" />
<item name="xiaodu" type="462c0819:PsiDirectoryNode" />
<item name="pojo" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="smartbox" type="b2602c69:ProjectViewProjectNode" />
<item name="smartbox" type="462c0819:PsiDirectoryNode" />
<item name="xiaodu" type="462c0819:PsiDirectoryNode" />
<item name="target" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="main" type="462c0819:PsiDirectoryNode" />
<item name="java" type="462c0819:PsiDirectoryNode" />
<item name="xiaodu" type="462c0819:PsiDirectoryNode" />
<item name="service" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="smartbox" type="b2602c69:ProjectViewProjectNode" />
<item name="smartbox" type="462c0819:PsiDirectoryNode" />
<item name="xiaodu" type="462c0819:PsiDirectoryNode" />
<item name="target" type="462c0819:PsiDirectoryNode" />
<item name="xiaodu" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="main" type="462c0819:PsiDirectoryNode" />
<item name="resources" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="smartbox" type="b2602c69:ProjectViewProjectNode" />
<item name="smartbox" type="462c0819:PsiDirectoryNode" />
<item name="xiaodu" type="462c0819:PsiDirectoryNode" />
<item name="target" type="462c0819:PsiDirectoryNode" />
<item name="xiaodu" type="462c0819:PsiDirectoryNode" />
<item name="WEB-INF" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="main" type="462c0819:PsiDirectoryNode" />
<item name="resources" type="462c0819:PsiDirectoryNode" />
<item name="static" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="smartbox" type="b2602c69:ProjectViewProjectNode" />
<item name="smartbox" type="462c0819:PsiDirectoryNode" />
<item name="xiaodu" type="462c0819:PsiDirectoryNode" />
<item name="target" type="462c0819:PsiDirectoryNode" />
<item name="xiaodu" type="462c0819:PsiDirectoryNode" />
<item name="WEB-INF" type="462c0819:PsiDirectoryNode" />
<item name="lib" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="main" type="462c0819:PsiDirectoryNode" />
<item name="resources" type="462c0819:PsiDirectoryNode" />
<item name="templates" type="462c0819:PsiDirectoryNode" />
</path>
</expand>
<select />
</subPane>
</pane>
<pane id="PackagesPane" />
<pane id="Scope" />
</panes>
</component>
<component name="PropertiesComponent">
<property name="DefaultHtmlFileTemplate" value="HTML File" />
<property name="RequestMappingsPanelOrder0" value="0" />
<property name="RequestMappingsPanelOrder1" value="1" />
<property name="RequestMappingsPanelOrder2" value="2" />
<property name="RequestMappingsPanelWidth0" value="75" />
<property name="RequestMappingsPanelWidth1" value="75" />
<property name="RequestMappingsPanelWidth2" value="75" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="aspect.path.notification.shown" value="true" />
<property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1562998547431" />
<property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1563601939667" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/../security/p1o6vt" />
<property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
<property name="nodejs_npm_path_reset_for_default_project" value="true" />
<property name="project.structure.last.edited" value="Modules" />
<property name="project.structure.proportion" value="0.0" />
<property name="project.structure.side.proportion" value="0.254023" />
<property name="settings.editor.selected.configurable" value="MavenSettings" />
<property name="settings.editor.selected.configurable" value="Errors" />
</component>
<component name="RecentsManager">
<key name="MoveFile.RECENT_KEYS">
......@@ -439,11 +504,11 @@
<recent name="ai.qiwu.mqw.rokid" />
</key>
<key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/xiaodu/src/main/resources/static/picture" />
<recent name="$PROJECT_DIR$/third_party_load/src/main/resources/static" />
<recent name="$PROJECT_DIR$/open/src/test/java/ai/qiwu/com/open/common/encryption" />
<recent name="$PROJECT_DIR$/open/src/main/java/ai/qiwu/com/open/controller" />
<recent name="$PROJECT_DIR$/open/src/main/java/ai/qiwu/com/open/service" />
<recent name="$PROJECT_DIR$/open/src/main/java/ai/qiwu/com/open/pojo" />
</key>
</component>
<component name="RunDashboard">
......@@ -459,12 +524,64 @@
</option>
</component>
<component name="RunManager" selected="ECS on Alibaba Cloud.xiaodu">
<configuration name="UploadAudio" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="ai.qiwu.com.open.common.utils.UploadAudio" />
<module name="open" />
<configuration name="AuthorizationServerConfig" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="ai.qiwu.com.third_party_load.config.AuthorizationServerConfig" />
<module name="third_party_load" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="ai.qiwu.com.third_party_load.config.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="LoadBySMS" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="ai.qiwu.baidu.xiaodu.service.LoadBySMS" />
<module name="xiaodu" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="ai.qiwu.baidu.xiaodu.service.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="ResponseEncapsulation" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="ai.qiwu.baidu.xiaodu.service.ResponseEncapsulation" />
<module name="xiaodu" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="ai.qiwu.baidu.xiaodu.service.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="SecurityConfig" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="ai.qiwu.com.third_party_load.config.SecurityConfig" />
<module name="third_party_load" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="ai.qiwu.com.third_party_load.config.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="XiaoDuController" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="ai.qiwu.baidu.xiaodu.controller.XiaoDuController" />
<module name="xiaodu" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="ai.qiwu.com.open.common.utils.*" />
<option name="PATTERN" value="ai.qiwu.baidu.xiaodu.controller.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
......@@ -562,6 +679,36 @@
<option name="Maven.BeforeRunTask" enabled="true" file="$PROJECT_DIR$/ruoqi/pom.xml" goal="clean install" />
</method>
</configuration>
<configuration name="security" type="ECS_RUN_CONFIGRATION" factoryName="Ecs configuration factory">
<option name="address" />
<option name="alreadyReset" value="true" />
<option name="autoOpen" value="false" />
<option name="command" value="sh $PROJECT_DIR$/../../../../springbootdemo/security/restart.sh" />
<option name="defaultTabIdx" value="0" />
<option name="ecsInstance">
<EcsInstance>
<option name="instanceId" value="i-hp3fcvrhszjkd3cs1one" />
<option name="instanceName" value="launch-advisor-20180824" />
<option name="netType" value="vpc" />
<option name="privateIps" value="172.24.163.142" />
<option name="publicIps" value="39.104.83.143" />
<option name="regionId" value="cn-huhehaote" />
<option name="tags">
<list />
</option>
</EcsInstance>
</option>
<option name="hostTagId" value="0" />
<option name="location" value="$PROJECT_DIR$/../../../../springbootdemo/security/" />
<option name="pathOrUrl" value="$PROJECT_DIR$/target/smartbox-1.0-SNAPSHOT.pom" />
<option name="tagId" value="0" />
<option name="terminalCommand" />
<option name="type" value="ECS" />
<option name="uploadType" value="MAVEN" />
<method v="2">
<option name="Maven.BeforeRunTask" enabled="true" file="$PROJECT_DIR$/third_party_load/pom.xml" goal="clean install" />
</method>
</configuration>
<configuration name="spirit" type="ECS_RUN_CONFIGRATION" factoryName="Ecs configuration factory">
<option name="address" />
<option name="alreadyReset" value="true" />
......@@ -723,13 +870,18 @@
</method>
</configuration>
<list>
<item itemvalue="Application.UploadAudio" />
<item itemvalue="Application.SecurityConfig" />
<item itemvalue="Application.AuthorizationServerConfig" />
<item itemvalue="Application.XiaoDuController" />
<item itemvalue="Application.LoadBySMS" />
<item itemvalue="Application.ResponseEncapsulation" />
<item itemvalue="ECS on Alibaba Cloud.dingdong" />
<item itemvalue="ECS on Alibaba Cloud.xiaodu" />
<item itemvalue="ECS on Alibaba Cloud.rokid" />
<item itemvalue="ECS on Alibaba Cloud.xiaoai" />
<item itemvalue="ECS on Alibaba Cloud.Open" />
<item itemvalue="ECS on Alibaba Cloud.spirit" />
<item itemvalue="ECS on Alibaba Cloud.security" />
<item itemvalue="Spring Boot.DingdongApplication" />
<item itemvalue="Spring Boot.RuoqiApplication" />
<item itemvalue="Spring Boot.SpiritApplication" />
......@@ -743,7 +895,11 @@
</list>
<recent_temporary>
<list>
<item itemvalue="Application.UploadAudio" />
<item itemvalue="Application.ResponseEncapsulation" />
<item itemvalue="Application.LoadBySMS" />
<item itemvalue="Application.XiaoDuController" />
<item itemvalue="Application.SecurityConfig" />
<item itemvalue="Application.AuthorizationServerConfig" />
</list>
</recent_temporary>
</component>
......@@ -777,15 +933,30 @@
<workItem from="1562808573705" duration="12927000" />
<workItem from="1562896129049" duration="9988000" />
<workItem from="1562914265589" duration="14763000" />
<workItem from="1562984526920" duration="8774000" />
<workItem from="1562984526920" duration="21955000" />
<workItem from="1563154641087" duration="31502000" />
<workItem from="1563240129359" duration="24476000" />
<workItem from="1563326794835" duration="35807000" />
<workItem from="1563413308778" duration="34124000" />
<workItem from="1563499776053" duration="35862000" />
<workItem from="1563585679709" duration="11043000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="358861000" />
<option name="totallyTimeSpent" value="544856000" />
</component>
<component name="TodoView">
<todo-panel id="selected-file">
<is-autoscroll-to-source value="true" />
</todo-panel>
<todo-panel id="all">
<are-packages-shown value="true" />
<is-autoscroll-to-source value="true" />
</todo-panel>
</component>
<component name="ToolWindowManager">
<frame x="544" y="82" width="1417" height="1004" extended-state="0" />
<frame x="454" y="64" width="1417" height="1004" extended-state="0" />
<editor active="true" />
<layout>
<window_info id="Structure" order="0" sideWeight="0.5052879" side_tool="true" weight="0.19576333" />
......@@ -796,14 +967,14 @@
<window_info id="Favorites" order="5" sideWeight="0.5017626" side_tool="true" weight="0.25712198" />
<window_info id="Alibaba Cloud Explorer" order="6" sideWeight="0.49941108" weight="0.3287071" />
<window_info id="Web" order="7" side_tool="true" />
<window_info active="true" content_ui="combo" id="Project" order="8" sideWeight="0.4947121" visible="true" weight="0.19868517" />
<window_info active="true" content_ui="combo" id="Project" order="8" sideWeight="0.4947121" visible="true" weight="0.27757487" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" weight="0.32902467" />
<window_info anchor="bottom" id="Run" order="2" weight="0.48178613" />
<window_info anchor="bottom" id="Run" order="2" weight="0.3039742" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.39929327" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="bottom" id="TODO" order="6" />
<window_info anchor="bottom" id="TODO" order="6" weight="0.3298122" />
<window_info anchor="bottom" id="Spring" order="7" weight="0.32902467" />
<window_info anchor="bottom" id="Terminal" order="8" weight="0.3278496" />
<window_info anchor="bottom" id="Docker" order="9" show_stripe_button="false" />
......@@ -812,17 +983,17 @@
<window_info anchor="bottom" id="Database Changes" order="12" />
<window_info anchor="bottom" id="Version Control" order="13" weight="0.32975295" />
<window_info anchor="bottom" id="Alibaba Cloud View" order="14" weight="0.32979977" />
<window_info anchor="bottom" id="Messages" order="15" weight="0.30199766" />
<window_info anchor="bottom" id="Messages" order="15" weight="0.36897767" />
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
<window_info anchor="right" id="Maven" order="3" weight="0.20745069" />
<window_info anchor="right" id="Palette" order="4" />
<window_info anchor="right" id="Capture Analysis" order="5" />
<window_info anchor="right" id="Database" order="6" weight="0.32967836" />
<window_info anchor="right" id="Palette&#9;" order="7" />
<window_info anchor="right" id="Theme Preview" order="8" />
<window_info anchor="right" id="Bean Validation" order="9" />
<window_info anchor="right" id="Palette" order="3" />
<window_info anchor="right" id="Capture Analysis" order="4" />
<window_info anchor="right" id="Database" order="5" weight="0.32943755" />
<window_info anchor="right" id="Palette&#9;" order="6" />
<window_info anchor="right" id="Theme Preview" order="7" />
<window_info anchor="right" id="Bean Validation" order="8" />
<window_info anchor="right" id="Maven" order="9" weight="0.20697288" />
</layout>
<layout-to-restore>
<window_info id="Structure" order="0" sideWeight="0.5041225" side_tool="true" weight="0.24908693" />
......@@ -866,423 +1037,419 @@
<option name="version" value="1" />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/open/src/main/java/ai/qiwu/com/open/common/utils/Schedule.java">
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/org/springframework/spring-context/5.1.8.RELEASE/spring-context-5.1.8.RELEASE.jar!/org/springframework/ui/ModelMap.class">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="748">
<caret line="61" column="72" selection-start-line="61" selection-start-column="72" selection-end-line="61" selection-end-column="72" />
<folding>
<element signature="imports" expanded="true" />
</folding>
<state relative-caret-position="154">
<caret line="17" column="16" selection-start-line="17" selection-start-column="16" selection-end-line="17" selection-end-column="16" />
</state>
</provider>
</entry>
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/junit/junit/4.12/junit-4.12-sources.jar!/org/junit/Assert.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="274">
<caret line="142" column="23" selection-start-line="142" selection-start-column="23" selection-end-line="142" selection-end-column="23" />
<folding>
<element signature="e#4403#4404#0" expanded="true" />
<element signature="e#4455#4456#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/open/src/test/java/ai/qiwu/com/open/common/encryption/WXBizMsgCryptTest.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="286">
<caret line="31" column="42" selection-start-line="31" selection-start-column="42" selection-end-line="31" selection-end-column="42" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/open/src/main/java/ai/qiwu/com/open/common/utils/BuildRequestResponse.java">
<entry file="file://$PROJECT_DIR$/open/pom.xml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="902">
<caret line="41" column="5" lean-forward="true" selection-start-line="41" selection-start-column="5" selection-end-line="41" selection-end-column="5" />
<folding>
<element signature="imports" expanded="true" />
</folding>
<state relative-caret-position="550">
<caret line="52" column="20" lean-forward="true" selection-start-line="52" selection-start-column="20" selection-end-line="52" selection-end-column="20" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/dingdong/src/main/java/ai/qiwu/dong/dingdong/service/ParseServiceCompromise.java">
<entry file="file://$PROJECT_DIR$/open/src/main/java/ai/qiwu/com/open/service/ParseRequest.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-3620">
<caret line="44" column="13" selection-start-line="44" selection-start-column="13" selection-end-line="44" selection-end-column="13" />
<state relative-caret-position="-594">
<caret line="19" column="13" selection-start-line="19" selection-start-column="13" selection-end-line="19" selection-end-column="13" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/dingdong/src/main/java/ai/qiwu/dong/dingdong/controller/DingDongController.java">
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/resources/templates/LoadFailed.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="440">
<caret line="28" column="10" selection-start-line="28" selection-start-column="10" selection-end-line="28" selection-end-column="10" />
<state relative-caret-position="66">
<caret line="3" column="72" lean-forward="true" selection-start-line="3" selection-start-column="4" selection-end-line="3" selection-end-column="72" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/dingdong/src/main/java/ai/qiwu/dong/dingdong/service/ParseService.java">
<entry file="file://$PROJECT_DIR$/open/src/main/java/ai/qiwu/com/open/front/RefreshView.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-110">
<caret line="168" column="37" selection-start-line="168" selection-start-column="37" selection-end-line="168" selection-end-column="37" />
<state relative-caret-position="281">
<caret line="34" column="36" lean-forward="true" selection-start-line="34" selection-start-column="36" selection-end-line="34" selection-end-column="36" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/open/src/main/java/ai/qiwu/com/open/service/OpenService.java">
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/org/apache/commons/commons-lang3/3.8.1/commons-lang3-3.8.1.jar!/org/apache/commons/lang3/StringUtils.class">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2017">
<caret line="109" column="55" selection-start-line="109" selection-start-column="55" selection-end-line="109" selection-end-column="55" />
<state relative-caret-position="168">
<caret line="31" column="26" selection-start-line="31" selection-start-column="26" selection-end-line="31" selection-end-column="26" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#6740#6741#0" expanded="true" />
<element signature="e#6775#6776#0" expanded="true" />
<element signature="e#906#907#0" expanded="true" />
<element signature="e#959#960#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/open/src/main/java/ai/qiwu/com/open/common/OpenConstants.java">
<entry file="file://$PROJECT_DIR$/open/src/main/java/ai/qiwu/com/open/service/RequestQiWu.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="411">
<caret line="29" column="29" selection-start-line="29" selection-start-column="29" selection-end-line="29" selection-end-column="29" />
<state relative-caret-position="440">
<caret line="39" column="48" lean-forward="true" selection-start-line="39" selection-start-column="48" selection-end-line="39" selection-end-column="48" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/common/Holder.java">
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/baidu/dueros/bot-sdk/1.2.0/bot-sdk-1.2.0.jar!/com/baidu/dueros/data/response/card/TextCard.class">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="176">
<caret line="8" column="13" selection-start-line="8" selection-start-column="13" selection-end-line="8" selection-end-column="13" />
<state relative-caret-position="222">
<caret line="22" column="27" lean-forward="true" selection-start-line="22" selection-start-column="27" selection-end-line="22" selection-end-column="27" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/open/src/main/resources/application.properties">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/baidu/dueros/bot-sdk/1.1.9/bot-sdk-1.1.9.jar!/com/baidu/dueros/nlu/Intent.class">
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/baidu/dueros/bot-sdk/1.2.0/bot-sdk-1.2.0.jar!/com/baidu/dueros/data/response/card/LinkAccountCard.class">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="814">
<caret line="52" column="29" selection-start-line="52" selection-start-column="29" selection-end-line="52" selection-end-column="29" />
<state relative-caret-position="220">
<caret line="14" column="13" selection-start-line="14" selection-start-column="13" selection-end-line="14" selection-end-column="13" />
</state>
</provider>
</entry>
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/baidu/dueros/bot-sdk/1.1.9/bot-sdk-1.1.9.jar!/com/baidu/dueros/model/Response.class">
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/resources/static/js/load.js">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/resources/application.properties">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="274">
<caret line="21" column="11" selection-start-line="21" selection-start-column="11" selection-end-line="21" selection-end-column="11" />
<folding>
<element signature="e#581#582#0" expanded="true" />
<element signature="e#629#630#0" expanded="true" />
</folding>
<state relative-caret-position="44">
<caret line="2" column="34" lean-forward="true" selection-start-line="2" selection-start-column="34" selection-end-line="2" selection-end-column="34" />
</state>
</provider>
</entry>
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/baidu/dueros/bot-sdk/1.1.9/bot-sdk-1.1.9.jar!/com/baidu/dueros/bot/AudioPlayer.class">
<entry file="file://$PROJECT_DIR$/open/src/main/java/ai/qiwu/com/open/common/utils/UpDownloadAudion.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="132">
<caret line="22" column="38" selection-start-line="22" selection-start-column="38" selection-end-line="22" selection-end-column="38" />
<state relative-caret-position="330">
<caret line="47" column="92" selection-start-line="47" selection-start-column="24" selection-end-line="47" selection-end-column="92" />
</state>
</provider>
</entry>
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/baidu/dueros/bot-sdk/1.1.9/bot-sdk-1.1.9.jar!/com/baidu/dueros/bot/BaseBot.class">
<entry file="file://$PROJECT_DIR$/third_party_load/pom.xml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="272">
<caret line="587" column="44" selection-start-line="587" selection-start-column="44" selection-end-line="587" selection-end-column="44" />
<folding>
<element signature="e#28418#28419#0" expanded="true" />
<element signature="e#28454#28455#0" expanded="true" />
</folding>
<state relative-caret-position="484">
<caret line="58" column="25" selection-start-line="58" selection-start-column="25" selection-end-line="58" selection-end-column="25" />
</state>
</provider>
</entry>
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/baidu/dueros/bot-sdk/1.1.9/bot-sdk-1.1.9.jar!/com/baidu/dueros/data/request/pay/event/ChargeEvent.class">
<entry file="file://$PROJECT_DIR$/xiaodu/pom.xml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="440">
<caret line="30" selection-start-line="30" selection-end-line="30" />
<state relative-caret-position="460">
<caret line="94" column="21" selection-start-line="94" selection-start-column="21" selection-end-line="94" selection-end-column="21" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/User.java">
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/common/CollectionUtils.java" />
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/GetUserInfoByToken.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="220">
<caret line="10" column="33" lean-forward="true" selection-start-line="10" selection-start-column="33" selection-end-line="10" selection-end-column="33" />
<state relative-caret-position="374">
<caret line="17" column="27" lean-forward="true" selection-start-line="17" selection-start-column="27" selection-end-line="17" selection-end-column="27" />
<folding>
<element signature="e#229#230#0" expanded="true" />
<element signature="e#277#278#0" expanded="true" />
<element signature="e#317#318#0" expanded="true" />
<element signature="e#352#353#0" expanded="true" />
<element signature="e#383#384#0" expanded="true" />
<element signature="e#431#432#0" expanded="true" />
<element signature="e#471#472#0" expanded="true" />
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/security/AuthorizationServer.java">
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/GetTokenByRefreshToken.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="660">
<caret line="30" column="5" selection-start-line="30" selection-start-column="5" selection-end-line="30" selection-end-column="5" />
<state relative-caret-position="484">
<caret line="22" column="27" selection-start-line="22" selection-start-column="27" selection-end-line="22" selection-end-column="27" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/controller/XiaoDuController.java">
<entry file="file://$PROJECT_DIR$/open/src/main/java/ai/qiwu/com/open/OpenApplication.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="462">
<caret line="28" column="46" selection-start-line="28" selection-start-column="46" selection-end-line="28" selection-end-column="46" />
<state relative-caret-position="110">
<caret line="7" selection-start-line="7" selection-end-line="7" selection-end-column="17" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/security/AuthenticationSuccessHandler.java">
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/XiaoduApplication.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="242">
<caret line="11" column="1" selection-start-line="11" selection-start-column="1" selection-end-line="11" selection-end-column="1" />
<state relative-caret-position="110">
<caret line="9" column="17" selection-start-line="9" selection-start-column="17" selection-end-line="9" selection-end-column="17" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/security/ApiUserDetailService.java">
<entry file="jar://$PROJECT_DIR$/../../../../java/jdk1.8.0_211/src.zip!/java/util/Iterator.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="418">
<caret line="19" column="20" selection-start-line="19" selection-start-column="20" selection-end-line="19" selection-end-column="20" />
<state relative-caret-position="188">
<caret line="91" column="17" selection-start-line="91" selection-start-column="17" selection-end-line="91" selection-end-column="17" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#2496#2497#0" expanded="true" />
<element signature="e#2561#2562#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/open/pom.xml">
<entry file="file://$PROJECT_DIR$/open/src/main/java/ai/qiwu/com/open/common/utils/Schedule.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="308">
<caret line="47" column="8" lean-forward="true" selection-start-line="47" selection-start-column="8" selection-end-line="51" selection-end-column="21" />
<state relative-caret-position="198">
<caret line="38" column="34" lean-forward="true" selection-start-line="38" selection-start-column="34" selection-end-line="38" selection-end-column="34" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/third_party_load/src/main/java/ai/qiwu/com/third_party_load/pojo/User.java">
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/baidu/dueros/bot-sdk/1.2.0/bot-sdk-1.2.0.jar!/com/baidu/dueros/bot/BaseBot.class">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="286">
<caret line="13" column="28" selection-start-line="13" selection-start-column="28" selection-end-line="13" selection-end-column="28" />
<state relative-caret-position="914">
<caret line="163" column="18" selection-start-line="163" selection-start-column="18" selection-end-line="163" selection-end-column="18" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#7440#7441#0" expanded="true" />
<element signature="e#7478#7479#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/AudioUrlAndText.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="132">
<caret line="6" column="13" selection-start-line="6" selection-start-column="13" selection-end-line="6" selection-end-column="13" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/product/CustomProductPrompts.java">
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/oauth2/AuthorizationController.java" />
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/resources/templates/Security_Load.html" />
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/TokenDuerosResponse.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="286">
<caret line="13" column="41" selection-start-line="13" selection-start-column="41" selection-end-line="13" selection-end-column="41" />
<caret line="13" column="13" selection-start-line="13" selection-start-column="13" selection-end-line="13" selection-end-column="13" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/product/Pricing.java">
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/common/OkHttp3Utils.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="330">
<caret line="15" column="26" lean-forward="true" selection-start-line="15" selection-start-column="26" selection-end-line="15" selection-end-column="26" />
<state relative-caret-position="269">
<caret line="56" column="25" selection-start-line="56" selection-start-column="25" selection-end-line="56" selection-end-column="25" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/product/PublishingInformation.java">
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/User.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="550">
<caret line="25" column="34" lean-forward="true" selection-start-line="25" selection-start-column="34" selection-end-line="25" selection-end-column="34" />
<state relative-caret-position="235">
<caret line="13" column="13" selection-start-line="13" selection-start-column="13" selection-end-line="13" selection-end-column="13" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/baidu/dueros/bot-sdk/1.1.9/bot-sdk-1.1.9.jar!/com/baidu/dueros/data/response/directive/Directive.class">
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/SecurityRequestParams.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="352">
<caret line="29" selection-start-line="29" selection-end-line="29" />
<state relative-caret-position="213">
<caret line="14" column="13" selection-start-line="14" selection-start-column="13" selection-end-line="14" selection-end-column="13" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/baidu/dueros/bot-sdk/1.1.9/bot-sdk-1.1.9.jar!/com/baidu/dueros/data/response/directive/pay/Charge.class">
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/TokenResponse.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="176">
<caret line="14" column="15" selection-start-line="14" selection-start-column="15" selection-end-line="14" selection-end-column="15" />
<state relative-caret-position="345">
<caret line="20" column="20" selection-start-line="20" selection-start-column="20" selection-end-line="20" selection-end-column="20" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/baidu/dueros/bot-sdk/1.1.9/bot-sdk-1.1.9.jar!/com/baidu/dueros/data/response/directive/pay/Payload.class">
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/resources/templates/LoadSuccess.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="110">
<caret line="8" column="21" selection-start-line="8" selection-start-column="21" selection-end-line="8" selection-end-column="21" />
<state relative-caret-position="484">
<caret line="22" column="7" lean-forward="true" selection-start-line="22" selection-start-column="7" selection-end-line="22" selection-end-column="7" />
</state>
</provider>
</entry>
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/baidu/dueros/bot-sdk/1.1.9/bot-sdk-1.1.9.jar!/com/baidu/dueros/data/response/directive/pay/ChargeBaiduPay.class">
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/common/Constants.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="110">
<caret line="8" column="42" selection-start-line="8" selection-start-column="42" selection-end-line="8" selection-end-column="42" />
<state relative-caret-position="188">
<caret line="13" column="15" selection-start-line="13" selection-start-column="15" selection-end-line="13" selection-end-column="15" />
</state>
</provider>
</entry>
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/baidu/dueros/bot-sdk/1.1.9/bot-sdk-1.1.9.jar!/com/baidu/dueros/data/response/ResponseBody.class">
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/baiduLoad/BaiDuLoad.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-66">
<caret line="18" column="19" selection-start-line="18" selection-start-column="19" selection-end-line="18" selection-end-column="19" />
<state relative-caret-position="563">
<caret line="40" column="81" lean-forward="true" selection-start-line="40" selection-start-column="81" selection-end-line="40" selection-end-column="81" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/baidu/dueros/bot-sdk/1.2.0/bot-sdk-1.2.0.jar!/com/baidu/dueros/model/Request.class">
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/resources/templates/LoadBaiDu.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="286">
<caret line="20" column="38" lean-forward="true" selection-start-line="20" selection-start-column="38" selection-end-line="20" selection-end-column="38" />
<state relative-caret-position="154">
<caret line="7" column="13" lean-forward="true" selection-start-line="7" selection-start-column="13" selection-end-line="7" selection-end-column="13" />
</state>
</provider>
</entry>
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/baidu/dueros/bot-sdk/1.2.0/bot-sdk-1.2.0.jar!/com/baidu/dueros/data/request/SkillInfo.class">
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/resources/templates/Oauth2RedirectCode.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="132">
<caret line="13" column="13" selection-start-line="13" selection-start-column="13" selection-end-line="13" selection-end-column="13" />
<state relative-caret-position="286">
<caret line="16" column="60" lean-forward="true" selection-start-line="16" selection-start-column="60" selection-end-line="16" selection-end-column="60" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/resources/application.properties">
<entry file="jar://$PROJECT_DIR$/../../../../java/jdk1.8.0_211/src.zip!/java/lang/String.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="44">
<caret line="2" column="26" selection-start-line="2" selection-start-column="26" selection-end-line="2" selection-end-column="26" />
<state relative-caret-position="406">
<caret line="1805" column="15" selection-start-line="1805" selection-start-column="15" selection-end-line="1805" selection-end-column="15" />
<folding>
<element signature="e#70749#70750#0" expanded="true" />
<element signature="e#70802#70803#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/dingdong/src/main/java/ai/qiwu/dong/dingdong/DingdongApplication.java">
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/resources/templates/LoadBySMS.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="110">
<caret line="8" column="69" selection-start-line="8" selection-start-column="41" selection-end-line="8" selection-end-column="69" />
<state relative-caret-position="506">
<caret line="23" column="72" selection-start-line="23" selection-start-column="72" selection-end-line="23" selection-end-column="72" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/XiaoduApplication.java">
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/org/apache/tomcat/embed/tomcat-embed-core/9.0.21/tomcat-embed-core-9.0.21.jar!/javax/servlet/http/HttpServletRequest.class">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="286">
<caret line="18" column="1" lean-forward="true" selection-start-line="18" selection-start-column="1" selection-end-line="18" selection-end-column="1" />
<state relative-caret-position="274">
<caret line="70" column="11" selection-start-line="70" selection-start-column="11" selection-end-line="70" selection-end-column="11" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/service/productManager/ProductManager.java">
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/org/apache/tomcat/embed/tomcat-embed-core/9.0.21/tomcat-embed-core-9.0.21.jar!/javax/servlet/ServletRequest.class">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="132">
<caret line="6" column="29" selection-start-line="6" selection-start-column="29" selection-end-line="6" selection-end-column="29" />
<state relative-caret-position="162">
<caret line="37" column="26" selection-start-line="37" selection-start-column="26" selection-end-line="37" selection-end-column="26" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/service/RequestTerminal.java">
<entry file="file://$PROJECT_DIR$/open/src/main/java/ai/qiwu/com/open/common/utils/MessageUtil.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="176">
<caret line="23" column="6" selection-start-line="23" selection-start-column="6" selection-end-line="23" selection-end-column="6" />
<state relative-caret-position="110">
<caret line="20" column="13" selection-start-line="20" selection-start-column="13" selection-end-line="20" selection-end-column="13" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaoai/pom.xml">
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/common/HttpRequestUtils.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="726">
<caret line="63" column="19" selection-start-line="63" selection-start-column="19" selection-end-line="63" selection-end-column="19" />
<state relative-caret-position="293">
<caret line="16" column="13" selection-start-line="16" selection-start-column="13" selection-end-line="16" selection-end-column="13" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/third_party_load/pom.xml">
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/controller/LoadFrontController.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="609">
<caret line="50" column="29" selection-start-line="50" selection-start-column="29" selection-end-line="50" selection-end-column="29" />
<state>
<caret line="12" selection-start-line="12" selection-end-line="12" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/spirit/pom.xml">
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/controller/XiaoDuController.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1210">
<caret line="94" column="84" selection-start-line="94" selection-start-column="84" selection-end-line="94" selection-end-column="84" />
<state relative-caret-position="374">
<caret line="29" column="36" selection-start-line="29" selection-start-column="36" selection-end-line="29" selection-end-column="36" />
<folding>
<element signature="e#1343#1344#0" expanded="true" />
<element signature="e#1430#1431#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaodu/pom.xml">
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/CaptchaSmsResponse.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-198">
<caret line="30" column="25" selection-start-line="30" selection-start-column="25" selection-end-line="30" selection-end-column="25" />
<state relative-caret-position="286">
<caret line="13" column="13" selection-start-line="13" selection-start-column="13" selection-end-line="13" selection-end-column="13" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="jar://$PROJECT_DIR$/third_party_load/src/main/resources/static/bot-sdk-1.2.0.jar!/com/baidu/dueros/data/response/directive/pay/SellerOrderAttributes.class">
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/common/Holder.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="88">
<caret line="7" column="13" selection-start-line="7" selection-start-column="13" selection-end-line="7" selection-end-column="13" />
<state relative-caret-position="176">
<caret line="8" column="13" selection-start-line="8" selection-start-column="13" selection-end-line="8" selection-end-column="13" />
</state>
</provider>
</entry>
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/baidu/dueros/bot-sdk/1.2.0/bot-sdk-1.2.0.jar!/com/baidu/dueros/data/response/directive/pay/Buy.class">
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/common/TokenHolder.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="814">
<caret line="50" column="15" selection-start-line="50" selection-start-column="15" selection-end-line="50" selection-end-column="15" />
<state relative-caret-position="286">
<caret line="13" column="13" selection-start-line="13" selection-start-column="13" selection-end-line="13" selection-end-column="13" />
<folding>
<element signature="e#1245#1246#0" expanded="true" />
<element signature="e#1295#1296#0" expanded="true" />
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="jar://$PROJECT_DIR$/third_party_load/src/main/resources/static/bot-sdk-1.2.0.jar!/com/baidu/dueros/certificate/Certificate.class">
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/service/ScheduleTask.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="220">
<caret line="29" column="61" lean-forward="true" selection-start-line="29" selection-start-column="61" selection-end-line="29" selection-end-column="61" />
<state relative-caret-position="704">
<caret line="32" selection-start-line="32" selection-end-line="32" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="jar://$PROJECT_DIR$/third_party_load/src/main/resources/static/bot-sdk-1.2.0.jar!/com/baidu/dueros/model/ResponseEncapsulation.class">
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/common/Utils.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="550">
<caret line="36" column="5" lean-forward="true" selection-start-line="36" selection-start-column="5" selection-end-line="36" selection-end-column="5" />
<state relative-caret-position="-1239">
<caret line="10" column="3" lean-forward="true" selection-start-line="10" selection-start-column="3" selection-end-line="10" selection-end-column="3" />
<folding>
<element signature="e#2360#2361#0" expanded="true" />
<element signature="e#2416#2417#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="jar://$PROJECT_DIR$/third_party_load/src/main/resources/static/bot-sdk-1.2.0.jar!/com/baidu/dueros/model/Response.class">
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/resources/templates/Oauth2_load.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="132">
<caret line="12" column="13" selection-start-line="12" selection-start-column="13" selection-end-line="12" selection-end-column="13" />
<state relative-caret-position="484">
<caret line="28" column="36" lean-forward="true" selection-start-line="28" selection-start-column="36" selection-end-line="28" selection-end-column="36" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/service/ResponseEncapsulation.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="587">
<caret line="316" column="19" lean-forward="true" selection-start-line="316" selection-start-column="19" selection-end-line="316" selection-end-column="19" />
<state relative-caret-position="477">
<caret line="351" column="5" lean-forward="true" selection-start-line="351" selection-start-column="5" selection-end-line="351" selection-end-column="5" />
<folding>
<element signature="e#4597#4650#0" />
<element signature="e#6944#6959#0" />
<element signature="e#6035#6088#0" />
<element signature="e#10040#10055#0" />
<element signature="e#13141#13206#0" />
<element signature="e#13537#13549#0" />
<element signature="e#17062#17118#0" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/product/Product.java">
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/service/LoadBySMS.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="374">
<caret line="17" lean-forward="true" selection-start-line="17" selection-end-line="17" />
<state relative-caret-position="266">
<caret line="85" column="19" selection-start-line="85" selection-start-column="19" selection-end-line="85" selection-end-column="19" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#1007#1016#0" />
<element signature="e#1792#1825#0" />
<element signature="e#4529#4548#0" />
<element signature="e#6636#6637#0" expanded="true" />
<element signature="e#6669#6670#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/product/ProductEnumItem.java">
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/controller/Oauth2Controller.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="220">
<caret line="10" column="19" selection-start-line="10" selection-start-column="19" selection-end-line="10" selection-end-column="19" />
<state relative-caret-position="961">
<caret line="143" column="24" lean-forward="true" selection-start-line="143" selection-start-column="24" selection-end-line="143" selection-end-column="24" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
......
......@@ -23,22 +23,20 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
<version>2.1.6.RELEASE</version>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.security.oauth/spring-security-oauth2 -->
<dependency>
<groupId>org.springframework.security.oauth</groupId>
<artifactId>spring-security-oauth2</artifactId>
<version>2.3.6.RELEASE</version>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-oauth2</artifactId>
<version>2.1.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
......@@ -46,13 +44,49 @@
<version>1.18.8</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.9</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-collections4 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>4.4</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-beanutils/commons-beanutils -->
<dependency>
<groupId>com.baidu.bot</groupId>
<artifactId>baidu-sdk</artifactId>
<version>1.0.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/static/bot-sdk-1.2.0.jar</systemPath>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.3</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!--<dependency>-->
<!--<groupId>org.springframework.security.oauth</groupId>-->
<!--<artifactId>spring-security-oauth2</artifactId>-->
<!--<version>2.2.0.RELEASE</version>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>com.baidu.bot</groupId>-->
<!--<artifactId>baidu-sdk</artifactId>-->
<!--<version>1.0.0</version>-->
<!--<scope>system</scope>-->
<!--<systemPath>${project.basedir}/src/main/resources/static/bot-sdk-1.2.0.jar</systemPath>-->
<!--</dependency>-->
</dependencies>
<build>
......
......@@ -2,6 +2,8 @@ package ai.qiwu.com.third_party_load;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableAuthorizationServer;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;
@SpringBootApplication
public class ThirdPartyLoadApplication {
......
package ai.qiwu.com.third_party_load.browser.handler;
import ai.qiwu.com.third_party_load.pojo.SimpleResponse;
import ai.qiwu.com.third_party_load.properties.LoginType;
import ai.qiwu.com.third_party_load.properties.SecurityProperties;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler;
import org.springframework.stereotype.Component;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* @author 苗权威
* @dateTime 19-7-17 上午10:38
*/
@Component
@Slf4j
public class MqwAuthenticationFailureHandler extends SimpleUrlAuthenticationFailureHandler {
@Autowired
private ObjectMapper objectMapper;
@Autowired
private SecurityProperties securityProperties;
@Override
public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response,
AuthenticationException exception) throws IOException, ServletException {
log.info("登录失败");
if (LoginType.JSON.equals(securityProperties.getBrowser().getLoginType())) {
response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());
response.setContentType("application/json;charset=UTF-8");
//将authentication这个对象转成json格式的字符串
response.getWriter().write(objectMapper.writeValueAsString(new SimpleResponse(exception.getMessage())));
} else {
super.onAuthenticationFailure(request, response, exception);
}
}
}
package ai.qiwu.com.third_party_load.browser.handler;
import ai.qiwu.com.third_party_load.properties.LoginType;
import ai.qiwu.com.third_party_load.properties.SecurityProperties;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler;
import org.springframework.stereotype.Component;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* @author 苗权威
* @dateTime 19-7-17 上午9:46
*/
@Component
@Slf4j
public class MqwAuthenticationSuccessHandler extends SavedRequestAwareAuthenticationSuccessHandler {
@Autowired
private ObjectMapper objectMapper;
@Autowired
private SecurityProperties securityProperties;
@Override
public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws ServletException, IOException {
log.info("登录成功");
if (LoginType.JSON.equals(securityProperties.getBrowser().getLoginType())) {
response.setContentType("application/json;charset=UTF-8");
response.getWriter().write(objectMapper.writeValueAsString(authentication));
} else {
super.onAuthenticationSuccess(request, response, authentication);
}
}
}
package ai.qiwu.com.third_party_load.config;
import ai.qiwu.com.third_party_load.properties.SecurityConstants;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.web.authentication.AuthenticationFailureHandler;
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
/**
* @author 苗权威
* @dateTime 19-7-17 上午10:01
*/
public class AbstractChannelSecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
private AuthenticationSuccessHandler mqwAuthenticationSuccessHandler;
@Autowired
private AuthenticationFailureHandler mqwAuthenticationFailureHandler;
protected void applyPasswordAuthenticationConfig(HttpSecurity httpSecurity) throws Exception {
httpSecurity.formLogin()
.loginPage(SecurityConstants.DEFAULT_LOGIN_PROCESSING_URL_FORM)
.loginProcessingUrl(SecurityConstants.DEFAULT_UNAUTHENTICATION_URL)
.successHandler(mqwAuthenticationSuccessHandler)
.failureHandler(mqwAuthenticationFailureHandler);
}
}
package ai.qiwu.com.third_party_load.config;
import ai.qiwu.com.third_party_load.properties.OAuth2ClientProperties;
import ai.qiwu.com.third_party_load.properties.SecurityProperties;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.oauth2.config.annotation.builders.InMemoryClientDetailsServiceBuilder;
import org.springframework.security.oauth2.config.annotation.configurers.ClientDetailsServiceConfigurer;
import org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerConfigurerAdapter;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableAuthorizationServer;
import org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerEndpointsConfigurer;
import org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerSecurityConfigurer;
import org.springframework.security.oauth2.provider.token.DefaultTokenServices;
import org.springframework.security.oauth2.provider.token.TokenEnhancer;
import org.springframework.security.oauth2.provider.token.TokenEnhancerChain;
import org.springframework.security.oauth2.provider.token.TokenStore;
import org.springframework.security.oauth2.provider.token.store.InMemoryTokenStore;
import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter;
import org.springframework.security.oauth2.provider.token.store.JwtTokenStore;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
/**
* @author 苗权威
* @dateTime 19-7-15 上午10:40
*/
@Configuration
@EnableAuthorizationServer
public class AuthorizationServerConfig extends AuthorizationServerConfigurerAdapter {
@Autowired
private AuthenticationManager authenticationManager;
@Autowired
private UserDetailsService userDetailsService;
@Autowired
private SecurityProperties securityProperties;
@Autowired
private TokenStore tokenStore;
@Autowired(required = false)
private JwtAccessTokenConverter jwtAccessTokenConverter;
@Autowired(required = false)
private TokenEnhancer jwtTokenEnhancer;
@Override
public void configure(AuthorizationServerEndpointsConfigurer endpoints) throws Exception {
endpoints
.tokenStore(tokenStore)
.authenticationManager(authenticationManager)
.userDetailsService(userDetailsService);
if (jwtAccessTokenConverter != null && jwtTokenEnhancer != null) {
TokenEnhancerChain enhancerChain = new TokenEnhancerChain();
List<TokenEnhancer> enhancers = new ArrayList<>();
enhancers.add(jwtTokenEnhancer);
enhancers.add(jwtAccessTokenConverter);
enhancerChain.setTokenEnhancers(enhancers);
endpoints.tokenEnhancer(enhancerChain)
.accessTokenConverter(jwtAccessTokenConverter);
}
}
@Override
public void configure(AuthorizationServerSecurityConfigurer security) throws Exception {
security.tokenKeyAccess("permitAll()");
}
@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
InMemoryClientDetailsServiceBuilder builder = clients.inMemory();
if (ArrayUtils.isNotEmpty(securityProperties.getOauth2().getClients())) {
for (OAuth2ClientProperties config : securityProperties.getOauth2().getClients()) {
builder.withClient(config.getClientId())
.secret(config.getClientSecret())
.authorizedGrantTypes("refresh_token","password","authorization_code")
.refreshTokenValiditySeconds(2592000)
.scopes("all","read","write");
}
}
}
}
package ai.qiwu.com.third_party_load.config;
import ai.qiwu.com.third_party_load.properties.SecurityProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;
import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter;
/**
* @author 苗权威
* @dateTime 19-7-15 下午6:05
*/
@Configuration
@EnableResourceServer
public class OAuth2ResourceServer extends ResourceServerConfigurerAdapter {
@Override
public void configure(HttpSecurity http) throws Exception {
http.authorizeRequests().anyRequest().authenticated()
.and().requestMatchers().antMatchers("/api/**");
}
}
package ai.qiwu.com.third_party_load.config;
import ai.qiwu.com.third_party_load.properties.SecurityProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.NoOpPasswordEncoder;
/**
* @author 苗权威
* @dateTime 19-7-15 上午10:34
*/
//@Order(1)
public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.inMemoryAuthentication().withUser("user")
.password("123456").roles("USER").and().passwordEncoder(passwordEncoder());
}
@Bean
public static BCryptPasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests().anyRequest().authenticated().and().formLogin().permitAll();
}
}
package ai.qiwu.com.third_party_load.config;
import ai.qiwu.com.third_party_load.properties.SecurityProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
/**
* @author 苗权威
* @dateTime 19-7-17 上午9:41
*/
@Configuration
@EnableConfigurationProperties(SecurityProperties.class)
public class SecurityCoreConfig {
@Bean
public PasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
}
}
package ai.qiwu.com.third_party_load.controller;
import ai.qiwu.com.third_party_load.pojo.SimpleResponse;
import ai.qiwu.com.third_party_load.properties.SecurityConstants;
import ai.qiwu.com.third_party_load.properties.SecurityProperties;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.security.web.DefaultRedirectStrategy;
import org.springframework.security.web.RedirectStrategy;
import org.springframework.security.web.savedrequest.HttpSessionRequestCache;
import org.springframework.security.web.savedrequest.RequestCache;
import org.springframework.security.web.savedrequest.SavedRequest;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* @author 苗权威
* @dateTime 19-7-17 上午10:47
*/
@RestController
@Slf4j
public class BrowserSecurityController {
private RequestCache requestCache = new HttpSessionRequestCache();
private RedirectStrategy redirectStrategy = new DefaultRedirectStrategy();
@Autowired
private SecurityProperties securityProperties;
/**
* 当需要身份认证时,跳转到这里
* @param request
* @param response
* @return
*/
@RequestMapping(SecurityConstants.DEFAULT_UNAUTHENTICATION_URL)
@ResponseStatus(code = HttpStatus.UNAUTHORIZED) //401
public SimpleResponse requireAuthentication(HttpServletRequest request,
HttpServletResponse response) throws IOException {
SavedRequest savedRequest = requestCache.getRequest(request, response);
if (savedRequest != null) {
String target = savedRequest.getRedirectUrl();
log.info("引发跳转的请求是:{}", target);
if (StringUtils.endsWithIgnoreCase(target, ".html")) {
redirectStrategy.sendRedirect(request, response, securityProperties.getBrowser().getLoginPage());
}
}
return new SimpleResponse("访问的服务需要身份认证,引导用户到登录页");
}
}
package ai.qiwu.com.third_party_load.controller;
import ai.qiwu.com.third_party_load.pojo.UserProfile;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.User;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author 苗权威
* @dateTime 19-7-15 下午6:00
*/
@RestController
public class UserController {
@RequestMapping("/api/profile")
public ResponseEntity<UserProfile> profile() {
User user = (User) SecurityContextHolder.getContext()
.getAuthentication().getPrincipal();
String email = user.getUsername() + "@email.com";
UserProfile profile = new UserProfile();
profile.setName(user.getUsername());
profile.setEmail(email);
return ResponseEntity.ok(profile);
}
}
package ai.qiwu.com.third_party_load.handler;
import org.springframework.security.core.Authentication;
import org.springframework.security.oauth2.common.exceptions.UnapprovedClientAuthenticationException;
import org.springframework.security.oauth2.provider.OAuth2Request;
import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* @author 苗权威
* @dateTime 19-7-15 下午1:59
*/
public class XiaoDuLoginSuccessHandler extends SavedRequestAwareAuthenticationSuccessHandler {
@Override
public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws ServletException, IOException {
String header = request.getHeader("Authorization");
String name = authentication.getName();
if (header == null || !header.startsWith("Basic ")) {
throw new UnapprovedClientAuthenticationException("请求头中无client信息");
}
}
}
package ai.qiwu.com.third_party_load.pojo;
/**
* @author 苗权威
* @dateTime 19-7-16 下午2:39
*/
public interface IUservice {
}
package ai.qiwu.com.third_party_load.pojo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
/**
* @author 苗权威
* @dateTime 19-7-17 上午10:41
*/
@Getter
@Setter
@AllArgsConstructor
public class SimpleResponse {
private Object content;
}
......@@ -9,7 +9,7 @@ import lombok.Setter;
*/
@Getter
@Setter
public class User {
private String userId;
private String userName;
public class UserProfile {
private String email;
private String name;
}
package ai.qiwu.com.third_party_load.properties;
import lombok.Getter;
import lombok.Setter;
/**
* @author 苗权威
* @dateTime 19-7-17 上午10:30
*/
@Getter
@Setter
public class BrowserProperties {
/**
* 登录页面,当引发登录行为的url以html结尾时,会跳到这里配置的url上
*/
private String loginPage = SecurityConstants.DEFAULT_LOGIN_PROCESSING_URL_FORM;
/**
* 退出成功时跳转的url,如果配置了,则跳到指定的url,如果没配置,则返回json数据
*/
private String signOutUrl;
/**
* 登录响应的方式,默认是json
*/
private LoginType loginType = LoginType.JSON;
/**
* 登录成功后跳转的地址,如果设置了此属性,则登录成功后总是会跳到这个地址上。
* 只在signInResponseType为REDIRECT时生效
*/
private String signInSuccessUrl;
}
package ai.qiwu.com.third_party_load.properties;
import ai.qiwu.com.third_party_load.config.AbstractChannelSecurityConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigurationMetadata;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.core.userdetails.UserDetailsService;
import javax.sql.DataSource;
/**
* @author 苗权威
* @dateTime 19-7-17 上午9:51
*/
@Configuration
public class BrowserSecurityConfig extends AbstractChannelSecurityConfig {
@Autowired
private SecurityProperties securityProperties;
@Autowired
private DataSource dataSource;
@Autowired
private UserDetailsService userDetailsService;
@Override
protected void configure(HttpSecurity http) throws Exception {
//这是密码登录相关的配置
applyPasswordAuthenticationConfig(http);
super.configure(http);
}
}
package ai.qiwu.com.third_party_load.properties;
/**
* @author 苗权威
* @dateTime 19-7-17 上午9:49
*/
public enum LoginType {
REDIRECT, JSON
}
package ai.qiwu.com.third_party_load.properties;
import lombok.Getter;
import lombok.Setter;
/**
* @author 苗权威
* @dateTime 19-7-16 上午10:43
*/
@Getter
@Setter
public class OAuth2ClientProperties {
private String clientId;
private String clientSecret;
private String redirectUris;
/**
* 针对此应用发出的token的有效时间
*/
private int accessTokenValiditySeconds = 7200;
private int refreshAccessTokenValidateSeconds = 2592000;
}
package ai.qiwu.com.third_party_load.properties;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
/**
* @author 苗权威
* @dateTime 19-7-16 上午10:41
*/
@Getter
@Setter
public class OAuth2Properties {
private String jwtStringKey = "qiwu";
private OAuth2ClientProperties[] clients = {};
}
package ai.qiwu.com.third_party_load.properties;
/**
* @author 苗权威
* @dateTime 19-7-17 上午10:06
*/
public interface SecurityConstants {
/**
* 当请求需要身份认证时,默认跳转的url
*
*/
String DEFAULT_UNAUTHENTICATION_URL = "/authentication/require";
/**
* 默认的用户名密码登录请求处理url
*/
String DEFAULT_LOGIN_PROCESSING_URL_FORM = "/authentication/form";
}
package ai.qiwu.com.third_party_load.properties;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.stereotype.Component;
/**
* @author 苗权威
* @dateTime 19-7-16 上午10:39
*/
@Component
@ConfigurationProperties(prefix = "qiwu.security")
@Getter
@Setter
public class SecurityProperties {
private OAuth2Properties oauth2 = new OAuth2Properties();
private BrowserProperties browser = new BrowserProperties();
}
package ai.qiwu.com.third_party_load.service;
import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.security.crypto.factory.PasswordEncoderFactories;
import org.springframework.security.provisioning.InMemoryUserDetailsManager;
/**
* @author 苗权威
* @dateTime 19-7-16 下午2:31
*/
public class BootUserDetailService implements UserDetailsService {
@Override
public UserDetails loadUserByUsername(String s) throws UsernameNotFoundException {
return null;
}
}
#server:
# port: 9090
# servlet:
# context-path: /security
security:
user:
name: user
password: 123456
\ No newline at end of file
......@@ -11,7 +11,7 @@
<groupId>ai.qiwu.baidu</groupId>
<artifactId>xiaodu</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<!--<packaging>war</packaging>-->
<name>xiaodu</name>
<description>Demo project for Spring Boot</description>
......@@ -23,12 +23,12 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
<!--<exclusions>-->
<!--<exclusion>-->
<!--<groupId>org.springframework.boot</groupId>-->
<!--<artifactId>spring-boot-starter-tomcat</artifactId>-->
<!--</exclusion>-->
<!--</exclusions>-->
</dependency>
<!--添加servlet-api的依赖,用来打war包-->
......@@ -72,6 +72,27 @@
<version>1.18.8</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.0.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-thymeleaf -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
<version>2.1.6.RELEASE</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.58</version>
</dependency>
</dependencies>
<build>
......
......@@ -4,16 +4,18 @@ import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.scheduling.annotation.EnableScheduling;
@SpringBootApplication
public class XiaoduApplication extends SpringBootServletInitializer{
@EnableScheduling
public class XiaoduApplication{
public static void main(String[] args) {
SpringApplication.run(XiaoduApplication.class, args);
}
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
return builder.sources(XiaoduApplication.class);
}
// @Override
// protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
// return builder.sources(XiaoduApplication.class);
// }
}
package ai.qiwu.baidu.xiaodu.baiduLoad;
import ai.qiwu.baidu.xiaodu.common.Constants;
import ai.qiwu.baidu.xiaodu.common.OkHttp3Utils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import java.io.IOException;
import java.util.HashMap;
/**
* @author 苗权威
* @dateTime 19-7-19 上午10:13
*/
@Controller
@RequestMapping("/xiaodu/baidu")
@Slf4j
public class BaiDuLoad {
@RequestMapping("/load")
public String loadBaiDu() {
return "LoadBaiDu";
}
@RequestMapping("/code")
public @ResponseBody void redirectUri(@RequestParam String code, @RequestParam(required = false) String state) {
if (StringUtils.isNoneEmpty(state) && !"mqw".equals(state)) {
log.info("state:{}不符合",state);
return;
}
String tokenInfo = null;
HashMap<String, String> params = new HashMap<>();
params.put("grant_type", "authorization_code");
params.put("client_id", "dSG525LMr887uLlfAyK1C1ag");
params.put("client_secret", "1azuXoKHMSWT5MVNNkZ4C5mED23qySZh");
params.put("redirect_uri", "https://www.miaoshop.top/xiaodu/baidu/code");
params.put("code", code);
if (state != null) {
params.put("state", state);
}
try {
tokenInfo = OkHttp3Utils.doGet(Constants.BAI_DU.RETURN_BAIDU_TOKEN, params);
} catch (Exception e) {
log.error("获取Token出错:{}",e.toString());
return;
}
log.info("获取BAIDU的Token返回的信息:{}", tokenInfo);
}
}
......@@ -9,6 +9,13 @@ public interface Constants {
String QI_WU_INTERFACE = "http://aliyun-hz1.chewrobot.com:8070/api/chat";
String SERVICE_NAME = "BAIDU";
interface SKILL_SECURITY {
String REDIRECT_URI = "https://xiaodu.baidu.com/saiya/auth/3428011e7f55ec4c10b2da1b00a1675b";
String REDIRECT_URI_TEST = "https://xiaodu-dbp.baidu.com/saiya/auth/3428011e7f55ec4c10b2da1b00a1675b";
String CLIENT_ID = "aiqiwucom";
String CLIENT_SECRET = "miaoquanwei";
}
interface WelcomeWord {
String WELCOME = "在这里你就是主角,开始你的星辰大海吧,请说推荐作品";
String BEGIN_NO_RESPONSE = "咋还没开始就停住了,我们这里可有很多好玩的作品哦";
......@@ -29,4 +36,28 @@ public interface Constants {
String INTERFACE_ERROR = "终端接口请求出错";
String HTTP_CONNECTION_CLOSE_FAILED = "与终端的链接关闭错误";
}
interface ManageProduct {
String GET_TOKEN = "https://xiaodu.baidu.com/dbppay/skill-pay/product/token";
String CREATE_PRODUCT = "https://xiaodu.baidu.com/dbppay/skill-pay/product/inskillproducts";
String UPDATE_PRODUCT = "https://xiaodu.baidu.com/dbppay/skill-pay/product/inskillproducts";
String DELETE_PRODUCT = "https://xiaodu.baidu.com/dbppay/skill-pay/product/inskillproducts";
String QUERY_PRODUCT = "https://xiaodu.baidu.com/dbppay/skill-pay/product/inskillproducts";
String PUBLISH_PRODUCT = "https://xiaodu.baidu.com/dbppay/skill-pay/product/publish";
String GET_ALL_PRODUCT_SITUATION = "https://xiaodu.baidu.com/dbppay/skill-pay/saiya/v1/skills/inskillproducts";
}
interface XIAOWU_API {
String BASIC_PREFIX = "Basic ";
String BEARER = "Bearer ";
String CAPTCHA_SMS = "https://account-center-test.chewrobot.com/api/captcha/sms";
String SDK_TOKEN = "https://account-center-test.chewrobot.com/api/sdk/token";
String GET_USER_INFO_BY_TOKEN ="https://account-center-test.chewrobot.com/api/sdk/user/info";
}
interface BAI_DU {
String RETURN_BAIDU_TOKEN = "https://openapi.baidu.com/oauth/2.0/token";
String BAIDU_TOKEN = "https://openapi.baidu.com/oauth/2.0/token?grant_type=authorization_code&client_id=dSG525LMr887uLlfAyK1C1ag&client_secret=1azuXoKHMSWT5MVNNkZ4C5mED23qySZh&redirect_uri=https%3A%2F%2Fwww.miaoshop.top%2Fxiaodu%2Fbaidu%2Fcode&code=";
String BAIDU_AUTHORIZE = "https://openapi.baidu.com/oauth/2.0/authorize?response_type=code&client_id=dSG525LMr887uLlfAyK1C1ag&redirect_uri=https%3A%2F%2Fwww.miaoshop.top%2Fxiaodu%2Fbaidu%2Fcode&confirm_login=1&state=mqw";
}
}
package ai.qiwu.baidu.xiaodu.common;
import lombok.extern.slf4j.Slf4j;
import javax.servlet.http.HttpServletRequest;
import java.io.BufferedReader;
import java.io.IOException;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
/**
* @author 苗权威
* @dateTime 19-7-20 上午10:56
*/
@Slf4j
public class HttpRequestUtils {
public static void getLoadPageInfo(HttpServletRequest request) {
HashMap<String, Object> headers = new HashMap<>();
Enumeration<String> headerNames = request.getHeaderNames();
while (headerNames.hasMoreElements()) {
String headerName = headerNames.nextElement();
headers.put(headerName, request.getHeader(headerName));
}
log.info("请求头信息:{}", headers);
log.info("principal:{}",request.getUserPrincipal());
log.info("RemoteUser:{}",request.getRemoteUser());
log.info("ParameterMap:{}",request.getParameterMap().toString());
Map<String, String> params = new HashMap<>();
Enumeration<?> temp = request.getParameterNames();
if (temp != null) {
while (temp.hasMoreElements()) {
String name = (String)temp.nextElement();
params.put(name, request.getParameter(name));
}
}
log.info("请求参数信息:{}", params);
StringBuilder builder = new StringBuilder();
try (BufferedReader reader = request.getReader()){ ;
String str;
while ((str = reader.readLine()) != null) {
builder.append(str);
}
} catch (IOException e) {
e.printStackTrace();
}
log.info("请求体信息:{}", builder.toString());
}
}
package ai.qiwu.baidu.xiaodu.common;
import okhttp3.*;
import okhttp3.internal.http2.Header;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
/**
* @author 苗权威
* @dateTime 19-7-18 上午10:54
*/
public class OkHttp3Utils {
private static OkHttpClient client = new OkHttpClient();
public static String doGet(String url) throws IOException {
return doGet(url, new HashMap<>());
}
public static String doGet(String url, Map<String, String> params) throws IOException {
return doGet(url, params, new HashMap<>());
}
public static String doGet(String url, Map<String, String> params, Map<String, String> header) throws IOException {
Request.Builder builder = new Request.Builder();
Request request = builder.url(url).build();
HttpUrl.Builder urlBuild = request.url().newBuilder();
Headers.Builder headerBuilder = request.headers().newBuilder();
Iterator<Map.Entry<String, String>> headIterator = header.entrySet().iterator();
headIterator.forEachRemaining(e -> headerBuilder.add(e.getKey(), e.getValue()));
Iterator<Map.Entry<String, String>> paramsIterator = params.entrySet().iterator();
paramsIterator.forEachRemaining(e -> urlBuild.addQueryParameter(e.getKey(), e.getValue()));
builder.url(urlBuild.build()).headers(headerBuilder.build());
try (Response response = client.newCall(builder.build()).execute()){
return response.body().string();
}
}
public static String doPost(String url, Map<String, String> params) throws IOException {
return doPost(url, new HashMap<>(), params,null);
}
public static String doPost(String url, Map<String, String> params, Map<String, String> headers) throws IOException {
return doPost(url, headers, params, null);
}
public static String doPost(String url, File file) throws IOException {
return doPost(url , new HashMap<>(), new HashMap<>(), file);
}
public static String doPost(String url, Map<String, String> headers, Map<String, String> params, File file) throws IOException {
Request.Builder builder = new Request.Builder();
Request request = builder.url(url).build();
Headers.Builder headBuilder = request.headers().newBuilder();
Iterator<Map.Entry<String, String>> headIterator = headers.entrySet().iterator();
headIterator.forEachRemaining(e -> headBuilder.add(e.getKey(), e.getValue()));
MultipartBody.Builder requestBuilder = new MultipartBody.Builder();
Iterator<Map.Entry<String, String>> paramsIterator = params.entrySet().iterator();
paramsIterator.forEachRemaining(e -> requestBuilder.addFormDataPart(e.getKey(), e.getValue()));
if (file != null) {
requestBuilder.addFormDataPart("uploadFiles", file.getName(),
RequestBody.create(MediaType.parse("application/octet-stream"), file));
}
builder.headers(headBuilder.build()).post(requestBuilder.build());
try (Response response = client.newCall(builder.build()).execute()){
return response.body().string();
}
}
public static String doPost(String url, Map<String, String> headers, Map<String, String> params,
String fileName, byte[] fileByte) throws IOException {
Request.Builder builder = new Request.Builder();
Request request = builder.url(url).build();
Headers.Builder headBuilder = request.headers().newBuilder();
Iterator<Map.Entry<String, String>> headIterator = headers.entrySet().iterator();
headIterator.forEachRemaining(e -> headBuilder.add(e.getKey(), e.getValue()));
MultipartBody.Builder requestBuilder = new MultipartBody.Builder();
Iterator<Map.Entry<String, String>> paramsIterator = params.entrySet().iterator();
paramsIterator.forEachRemaining(e -> requestBuilder.addFormDataPart(e.getKey(), e.getValue()));
if (fileByte.length > 0) {
requestBuilder.addFormDataPart("uploadFiles", fileName,
RequestBody.create(MediaType.parse("application/octet-stream"), fileByte));
}
builder.headers(headBuilder.build()).post(requestBuilder.build());
try (Response response = client.newCall(builder.build()).execute()){
return response.body().string();
}
}
}
package ai.qiwu.baidu.xiaodu.common;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
/**
* @author 苗权威
* @dateTime 19-7-17 下午5:59
*/
@Getter
@Setter
@ToString
public class TokenHolder {
private volatile String userId;
private volatile String accessToken;
private volatile String refreshToken;
private volatile String timestamp;
// private volatile String state;
private volatile Integer expire;
}
package ai.qiwu.baidu.xiaodu.common;
import org.apache.commons.codec.binary.Base64;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.nio.charset.StandardCharsets;
import java.util.Objects;
/**
......@@ -12,6 +14,11 @@ import java.util.Objects;
*/
public class Utils {
/**
* 校验电话号码
*/
private static final String REGEX_MOBILE = "^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(17[013678])|(18[0,5-9]))\\d{8}$";
public static HttpServletRequest getHttpServletRequest() {
return ((ServletRequestAttributes) Objects.requireNonNull(RequestContextHolder
.getRequestAttributes())).getRequest();
......@@ -31,4 +38,59 @@ public class Utils {
}
return ip;
}
/**
* 验证小度请求登录时发来的信息
* @param clientId
* @param redirectUri
* @return
*/
public static boolean verifyLoadRequest(String clientId, String redirectUri) {
return Constants.SKILL_SECURITY.CLIENT_ID.equals(clientId) &&
Constants.SKILL_SECURITY.REDIRECT_URI_TEST.equals(redirectUri);
}
/**
* 验证小度请求Token时发来的信息
* @param clientId
* @param clientSecret
* @param redirectUri
* @return
*/
public static boolean verifyTokenRequest(String clientId, String clientSecret, String redirectUri) {
// log.info("clientID:{},clientSecret:{},redirectUri:{}", clientId, clientSecret, redirectUri);
return Constants.SKILL_SECURITY.CLIENT_ID.equals(clientId) &&
Constants.SKILL_SECURITY.REDIRECT_URI_TEST.equals(redirectUri) &&
Constants.SKILL_SECURITY.CLIENT_SECRET.equals(clientSecret);
}
/**
* 校验电话号码
* @param phoneNumber
* @return
*/
public static boolean verifyPhoneNumber(String phoneNumber) {
return phoneNumber.matches(REGEX_MOBILE);
}
/**
* Authorization:Basic+空格+base64加密后的电话号码
* @param phoneNumber
* @return
*/
public static String captchaAuthorization(String phoneNumber) {
return Constants.XIAOWU_API.BASIC_PREFIX + Base64.encodeBase64String(phoneNumber.getBytes());
}
/**
* Authorization:Basic+空格+base64加密后的(电话号码:验证码)
* @param phoneNumber
* @param captcha
* @return
*/
public static String tokenAuthorization(String phoneNumber, String captcha) {
String str = phoneNumber + ":" + captcha;
str = Base64.encodeBase64String(str.getBytes(StandardCharsets.UTF_8));
return Constants.XIAOWU_API.BASIC_PREFIX + str;
}
}
package ai.qiwu.baidu.xiaodu.controller;
import ai.qiwu.baidu.xiaodu.pojo.User;
import ai.qiwu.baidu.xiaodu.service.LoadBySMS;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import java.io.IOException;
/**
* @author 苗权威
* @dateTime 19-7-17 下午4:33
*/
@Controller
@Slf4j
public class LoadFrontController {
@Autowired
private LoadBySMS loadBySMS;
@GetMapping("/xiaodu/load")
public String load(ModelMap modelMap, @RequestParam(value = "userId") String userId) {
User user = new User();
user.setUserId(userId);
modelMap.put("userInfo", user);
return "LoadBySMS";
}
@RequestMapping("/xiaodu/captcha")
public @ResponseBody void getCaptcha(@RequestParam String phoneNumber) {
// 校验手机号
try {
loadBySMS.requireCaptcha(phoneNumber);
} catch (Exception e) {
log.error("获取验证码出错:{}", e.toString());
}
}
@PostMapping("/xiaodu/token")
public String getAccessToken(@ModelAttribute User user) {
log.info("请求Token的User信息{}", user);
String phoneNumber = user.getPhoneNumber();
String captcha = user.getCaptcha();
String userId = user.getUserId();
if (StringUtils.isNotEmpty(captcha) && StringUtils.isNoneEmpty(userId)) {
// 获取token
// boolean result;
// try {
// result = loadBySMS.requireToken(phoneNumber, captcha, userId);
// } catch (IOException e) {
// log.error("获取Token出错:{}", e.toString());
// result = false;
// }
// if (!result) return "LoadFailed";
return "LoadSuccess";
}else {
return "LoadFailed";
}
}
}
package ai.qiwu.baidu.xiaodu.controller;
import ai.qiwu.baidu.xiaodu.common.TokenHolder;
import ai.qiwu.baidu.xiaodu.common.Utils;
import ai.qiwu.baidu.xiaodu.pojo.TokenDuerosResponse;
import ai.qiwu.baidu.xiaodu.pojo.User;
import ai.qiwu.baidu.xiaodu.service.LoadBySMS;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.concurrent.ConcurrentHashMap;
/**
* 百度的第三方登录基于OAuth2.0的授权码模式,由于郊游天下平台还没有实现该种授权模式给第三方,
* 所以这里便根据OAuth2协议的内容来实现,从而满足Dueros的要求
* 切忌:验证方法enableVerify()一定要开启,否则回调地址会拒绝你
* @author 苗权威
* @dateTime 19-7-18 下午5:55
*/
@Controller
@RequestMapping(value = "/xiaodu/security")
@Slf4j
public class Oauth2Controller {
@Autowired
private LoadBySMS loadBySMS;
/**
* /xiaodu/security/load:这是小度授权信息配置里的“授权地址”,也就是登录卡片点击后跳转到的登录页面地址
* @param state 状态,例如在测试时传来的值是“debug”,在回调时该值若有需要原样返回
* @param scope 用户权限范围
* @param response_type code
* @param redirect_uri 回调地址
* @param client_id 我们设置的Client_id
* @param modelMap 用于传值
* @param request 测试时使用来查看请求头信息的
* @return 返回结果页
*/
@GetMapping("/load")
public String load(@RequestParam(required = false) String state, @RequestParam(required = false) String scope,
@RequestParam String response_type, @RequestParam String redirect_uri,
@RequestParam String client_id, ModelMap modelMap, HttpServletRequest request) {
//Dueros发来的登录请求信息
//HttpRequestUtils.getLoadPageInfo(request);
boolean verifyResult = Utils.verifyLoadRequest(client_id, redirect_uri);
if (!verifyResult) {
log.error("该登录请求不合规:client_id:{},redirect_uri:{}",client_id, redirect_uri);
return "LoadFailed";
}
User user = new User();
user.setState(state);
modelMap.put("userInfo", user);
return "Oauth2_load";
}
/**
* 用户点击获取短信验证码
* @param phoneNumber 电话号码
*/
@RequestMapping("/captcha")
public @ResponseBody
void getCaptcha(@RequestParam String phoneNumber) {
// 校验手机号
// log.info("电话号码:"+phoneNumber);
try {
loadBySMS.requireCaptcha(phoneNumber);
} catch (Exception e) {
log.error("获取验证码出错:{}", e.toString());
}
}
/**
* 用户点击登录后调用该方法,利用电话号码与短信验证码从郊游天下平台获取AccessToken与RefreshToken,
* 之后Oauth2_load页会重定向到回调地址,回调地址在收到后会请求我们设置的Token地址,
* 即/xiaodu/security/accessToken
* @param phoneNumber 电话号码
* @param captcha 短信验证码
* @return 1代表从郊游天下平台获取验证码成功
*/
@RequestMapping("/token")
public @ResponseBody String getAccessToken(@RequestParam String phoneNumber, @RequestParam String captcha) {
// log.info("电话号码:"+phoneNumber+",captcha:"+captcha);
if (StringUtils.isNotEmpty(captcha)) {
// 获取token
boolean result;
try {
result = loadBySMS.requireCodeToken(phoneNumber, captcha);
} catch (IOException e) {
log.error("获取Token出错:{}", e.toString());
result = false;
}
log.info("请求郊游天下Token返回结果:"+result);
if (result) {
return "1";
}else {
log.warn("请求郊游天下Token失败");
return "0";
}
}
else {
return "0";
}
}
/**
* 回调地址会主动请求该地址,我们返回给他Token
* @param grant_type authorization_code
* @param code 授权码
* @param client_id 我们设置的Client_id
* @param client_secret 我们设置的Client_secret
* @param redirect_uri 回调地址
* @return 按规定我们需要返回的信息格式如下:
* {
* "access_token": "ACCESS_TOKEN",
* "expires_in": 1234,
* "refresh_token":"REFRESH_TOKEN"
* }
*/
@RequestMapping("/accessToken")
public @ResponseBody TokenDuerosResponse returnTokenToDueros(@RequestParam String grant_type,
@RequestParam String code, @RequestParam String client_id,
@RequestParam String client_secret, @RequestParam String redirect_uri) {
log.info("小度请求Token,client_id:{};client_secret:{};redirect_uri:{};code:{}");
// 请求会出现发来的消息每个值重复一遍的情况,待解决?
client_id = client_id.substring(client_id.lastIndexOf(",")+1);
client_secret = client_secret.substring(client_secret.lastIndexOf(",")+1);
redirect_uri = redirect_uri.substring(redirect_uri.lastIndexOf(",")+1);
code = code.substring(code.lastIndexOf(",")+1);
boolean verifyResult = Utils.verifyTokenRequest(client_id, client_secret, redirect_uri);
if (!verifyResult) {
log.error("不合规的Token请求");
return null;
}
ConcurrentHashMap<String, TokenHolder> cache = LoadBySMS.getCodeToken();
TokenHolder holder = cache.get(code);
String accessToken;
if (holder == null || (accessToken =holder.getAccessToken())==null) {
log.error("没有对应的令牌");
return null;
}
cache.remove(code);
TokenDuerosResponse response = new TokenDuerosResponse();
response.setAccess_token(accessToken);
response.setRefresh_token(holder.getRefreshToken());
response.setExpires_in(holder.getExpire());
return response;
}
}
......@@ -2,13 +2,18 @@ package ai.qiwu.baidu.xiaodu.controller;
import ai.qiwu.baidu.xiaodu.common.Utils;
import ai.qiwu.baidu.xiaodu.service.ResponseEncapsulation;
import ai.qiwu.baidu.xiaodu.service.productManager.ProductManager;
import com.baidu.dueros.bot.BaseBot;
import org.apache.commons.codec.binary.Base64;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.io.IOException;
import java.util.Arrays;
/**
* @author 苗权威
* @dateTime 19-6-29 下午5:32cat
......@@ -22,12 +27,21 @@ public class XiaoDuController {
public String chat() {
try {
ResponseEncapsulation response = new ResponseEncapsulation(Utils.getHttpServletRequest());
//response.enableVerify();
response.disableVerify();
response.enableVerify();
//response.disableVerify();
return response.run();
} catch (Exception e) {
logger.info("出现错误 "+e.toString());
}
return null;
}
@RequestMapping("/xiaodu/publish")
public void publishProduct() {
logger.info("成功跳转");
}
public static void main(String[] args) {
System.out.println(Base64.encodeBase64String("miaoquanwei".getBytes()));
}
}
package ai.qiwu.baidu.xiaodu.pojo;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
/**
* @author 苗权威
* @dateTime 19-7-17 下午6:33
*/
@Getter
@Setter
@ToString
public class CaptchaSmsResponse {
private String message;
private String payload;
private Integer retcode;
private Integer status;
private Long timestamp;
}
package ai.qiwu.baidu.xiaodu.pojo;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
/**
* @author 苗权威
* @dateTime 19-7-18 下午1:42
*/
@Getter
@Setter
@ToString
public class GetTokenByRefreshToken {
private String accessToken;
private String message;
private String payload;
private String refreshToken;
private String tokenType;
private Integer expire;
private Integer retcode;
private Integer status;
private Long timestamp;
}
package ai.qiwu.baidu.xiaodu.pojo;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
/**
* @author 苗权威
* @dateTime 19-7-18 下午1:33
*/
@Getter
@Setter
@ToString
public class GetUserInfoByToken {
private String message;
private String payload;
private Integer retcode;
private Integer status;
}
package ai.qiwu.baidu.xiaodu.pojo;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.web.bind.annotation.RequestParam;
/**
* @author 苗权威
* @dateTime 19-7-18 下午5:37
*/
@Getter
@Setter
@ToString
public class SecurityRequestParams {
private String state;
private String client_id;
private String client_secret;
private String response_type;
private String scope;
private String redirect_uri;
private String grant_type;
private String code;
}
package ai.qiwu.baidu.xiaodu.pojo;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
/**
* @author 苗权威
* @dateTime 19-7-18 下午7:44
*/
@Getter
@Setter
@ToString
public class TokenDuerosResponse {
private String access_token;
private Integer expires_in;
private String refresh_token;
}
package ai.qiwu.baidu.xiaodu.pojo;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
/**
* @author 苗权威
* @dateTime 19-7-17 下午7:34
*/
@Getter
@Setter
@ToString
public class TokenResponse {
private String accessToken;
private String message;
private String payload;
private String refreshToken;
private String tokenType;
private Integer expire;
private Integer retcode;
private Integer status;
private Long timestamp;
}
package ai.qiwu.baidu.xiaodu.pojo;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
/**
* @author 苗权威
* @dateTime 19-7-12 下午8:47
*/
@Getter
@Setter
@ToString
public class User {
private String userId;
private String userName;
private String password;
private String phoneNumber;
private String captcha;
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
private String state;
}
......@@ -10,8 +10,8 @@ import lombok.Setter;
@Getter
@Setter
public class Product {
private Enum version;
private String version;
private String referenceName;
private Enum type;
private String type;
private PublishingInformation publishingInformation;
}
package ai.qiwu.baidu.xiaodu.pojo.product;
import sun.text.normalizer.VersionInfo;
/**
* @author 苗权威
* @dateTime 19-7-13 下午2:13
*/
public enum ProductEnumItem {
VERSION("1.0"),
VERSION("1.0"),TYPE("ENTITLEMENT"),PURCHASABLESTATE("PURCHASABLE")
;
private String value;
......
......@@ -23,5 +23,5 @@ public class PublishingInformation {
private CustomProductPrompts customProductPrompts;
private Pricing pricing;
private String skillId;
private Enum purchasableState;
private String purchasableState;
}
package ai.qiwu.baidu.xiaodu.pojo.product.response;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
/**
* @author 苗权威
* @dateTime 19-7-13 下午2:52
*/
@Getter
@Setter
@ToString
public class CreateProductResponse {
private Integer status;
private String msg;
private Data data;
}
package ai.qiwu.baidu.xiaodu.pojo.product.response;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
/**
* @author 苗权威
* @dateTime 19-7-13 下午2:52
*/
@Getter
@Setter
@ToString
public class Data {
private String productID;
}
package ai.qiwu.baidu.xiaodu.pojo.product.response;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
/**
* @author 苗权威
* @dateTime 19-7-13 下午3:09
*/
@Getter
@Setter
@ToString
public class GetTokenData {
private String token;
private Integer expireSeconds;
}
package ai.qiwu.baidu.xiaodu.pojo.product.response;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
/**
* @author 苗权威
* @dateTime 19-7-13 下午3:08
*/
@Getter
@Setter
@ToString
public class GetTokenResponse {
private Integer status;
private String msg;
private GetTokenData data;
}
package ai.qiwu.baidu.xiaodu.pojo.product.response;
import lombok.Getter;
import lombok.Setter;
/**
* @author 苗权威
* @dateTime 19-7-13 下午3:19
*/
@Getter
@Setter
public class PublishRequestBody {
private String productId;
}
package ai.qiwu.baidu.xiaodu.service;
import ai.qiwu.baidu.xiaodu.common.Constants;
import ai.qiwu.baidu.xiaodu.common.Constants.XIAOWU_API;
import ai.qiwu.baidu.xiaodu.common.OkHttp3Utils;
import ai.qiwu.baidu.xiaodu.common.TokenHolder;
import ai.qiwu.baidu.xiaodu.common.Utils;
import ai.qiwu.baidu.xiaodu.pojo.CaptchaSmsResponse;
import ai.qiwu.baidu.xiaodu.pojo.TokenResponse;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.io.IOException;
import java.util.HashMap;
import java.util.concurrent.ConcurrentHashMap;
/**
* 处理验证码,令牌的请求
* @author 苗权威
* @dateTime 19-7-17 下午5:53
*/
@Service
@Slf4j
public class LoadBySMS {
// private static final ConcurrentHashMap<String, TokenHolder> USER_TOKEN = new ConcurrentHashMap<>();
/**
* 手机号到TOKEN信息之间的映射
*/
private static final ConcurrentHashMap<String, TokenHolder> CODE_TOKEN = new ConcurrentHashMap<>();
// /**
// * 登录成功后每次请求都会携带AccessToken,这里存储AccessToken到手机号的映射,用于之后令牌过期取RefreshToken使用
// */
// private static final ConcurrentHashMap<String, String> ACCESSTOKEN_PHONENUM = new ConcurrentHashMap<>();
/**
* 通过电话号码获取短信验证码
* @param phoneNumber
* @return 是否成功获取
* @throws IOException
*/
public Boolean requireCaptcha(String phoneNumber) throws IOException {
// 校验手机号
phoneNumber = phoneNumber.trim();
if (!Utils.verifyPhoneNumber(phoneNumber)) {
return false;
}
String authorization = Utils.captchaAuthorization(phoneNumber);
int retCode = getCaptchaRequest(authorization);
return retCode == 0;
}
// 该方法用于TextCard触发登录以绕过小度的第三方登录模式
// public Boolean requireToken(String phoneNumber, String captcha, String userId) throws IOException {
// // 获取token
// Request request = new Request.Builder().url(XIAOWU_API.SDK_TOKEN)
// .addHeader("App-Channel-Id", "JIAOYOUTIANXIA")
// .addHeader("Authorization", tokenAuthorization(phoneNumber, captcha))
// .addHeader("Content-Type","application/json; charset=utf-8")
// .get().build();
// try (Response response = client.newCall(request).execute()){
// log.info("获取Token返回");
// TokenResponse tokenResponse = JSON.parseObject(response.body().string(), TokenResponse.class);
// log.info("获取Token返回信息:{}", tokenResponse);
// if (tokenResponse.getRetcode() == 0) {
// updateUserToken(userId, tokenResponse);
// return true;
// }else {
// return false;
// }
// }
// }
/**
* Oauth2Controller类调用的方法,根据电话号码与短信验证码向郊游天下请求令牌
* 我们将令牌信息与电话号码间构成map,用于之后Dueros请求Token时查找
* @param phoneNumber
* @param captcha 验证码
* @return 是否成功从平台获取到令牌信息
* @throws IOException
*/
public boolean requireCodeToken(String phoneNumber, String captcha) throws IOException {
HashMap<String, String> headers = new HashMap<>();
headers.put("App-Channel-Id", "JIAOYOUTIANXIA");
headers.put("Content-Type", "application/json;charset=utf-8");
headers.put("Authorization", Utils.tokenAuthorization(phoneNumber, captcha));
String tokenStr = OkHttp3Utils.doGet(XIAOWU_API.SDK_TOKEN, new HashMap<>(), headers);
// log.info("获取Token返回");
TokenResponse tokenResponse = JSON.parseObject(tokenStr, TokenResponse.class);
// log.info("获取Token返回信息:{}", tokenResponse);
if (tokenResponse.getRetcode() == 0) {
updateCodeToken(phoneNumber, tokenResponse);
return true;
}else {
return false;
}
}
/**
* 发起验证码获取请求
* @param authorization
* @throws IOException
*/
private Integer getCaptchaRequest(String authorization) throws IOException {
HashMap<String, String> headers = new HashMap<>();
headers.put("App-Channel-Id", "JIAOYOUTIANXIA");
headers.put("Content-Type", "application/json;charset=utf-8");
headers.put("Authorization", authorization);
String smsStr = OkHttp3Utils.doGet(XIAOWU_API.CAPTCHA_SMS, new HashMap<>(), headers);
// log.info("发送验证码成功");
CaptchaSmsResponse captchaResponse = JSON.parseObject(smsStr, CaptchaSmsResponse.class);
// log.info("获取验证码返回信息:{}", captchaResponse);
return captchaResponse.getRetcode();
}
//该方法是更新USER_TOKEN的
// private void updateUserToken(String userId, TokenResponse tokenResponse) {
// TokenHolder tokenHolder = USER_TOKEN.get(userId);
// if (tokenHolder == null) {
// tokenHolder = new TokenHolder();
// }
// tokenHolder.setUserId(userId);
// tokenHolder.setAccessToken(tokenResponse.getAccessToken());
// tokenHolder.setRefreshToken(tokenResponse.getRefreshToken());
// }
/**
* 更新token缓存信息
* @param phoneNumber
* @param tokenResponse
*/
private void updateCodeToken(String phoneNumber, TokenResponse tokenResponse) {
TokenHolder tokenHolder = CODE_TOKEN.get(phoneNumber);
if (tokenHolder == null) {
tokenHolder = new TokenHolder();
CODE_TOKEN.put(phoneNumber, tokenHolder);
}
tokenHolder.setExpire(tokenResponse.getExpire());
tokenHolder.setAccessToken(tokenResponse.getAccessToken());
tokenHolder.setRefreshToken(tokenResponse.getRefreshToken());
}
// static ConcurrentHashMap<String, TokenHolder> getUserToken() {
// return USER_TOKEN;
// }
/**
* 获取code-token的缓存map
* @return
*/
public static ConcurrentHashMap<String, TokenHolder> getCodeToken() {
return CODE_TOKEN;
}
// /**
// * 获取accesstoken-phonenumber的缓存map
// * @return
// */
// public static ConcurrentHashMap<String, String> getAccesstokenPhonenum() {
// return ACCESSTOKEN_PHONENUM;
// }
}
package ai.qiwu.baidu.xiaodu.service;
import ai.qiwu.baidu.xiaodu.common.Constants;
import ai.qiwu.baidu.xiaodu.common.Constants.ErrorMsg;
import ai.qiwu.baidu.xiaodu.common.Constants.EndMsg;
import ai.qiwu.baidu.xiaodu.common.Constants.WelcomeWord;
import ai.qiwu.baidu.xiaodu.common.OkHttp3Utils;
import ai.qiwu.baidu.xiaodu.common.TokenHolder;
import ai.qiwu.baidu.xiaodu.common.Utils;
import ai.qiwu.baidu.xiaodu.pojo.AudioUrlAndText;
import ai.qiwu.baidu.xiaodu.pojo.GetTokenByRefreshToken;
import ai.qiwu.baidu.xiaodu.pojo.GetUserInfoByToken;
import ai.qiwu.baidu.xiaodu.service.productManager.ProductManager;
import com.alibaba.fastjson.JSON;
import com.baidu.dueros.bot.AudioPlayer;
import com.baidu.dueros.data.request.*;
import com.baidu.dueros.data.request.audioplayer.event.PlaybackFinishedEvent;
import com.baidu.dueros.data.request.audioplayer.event.PlaybackStoppedEvent;
import com.baidu.dueros.data.request.buy.event.BuyEvent;
import com.baidu.dueros.data.request.events.LinkAccountSucceededEvent;
import com.baidu.dueros.data.request.pay.event.ChargeEvent;
import com.baidu.dueros.data.request.pay.event.Payload;
import com.baidu.dueros.data.response.OutputSpeech;
import com.baidu.dueros.data.response.Reprompt;
import com.baidu.dueros.data.response.card.Card;
import com.baidu.dueros.data.response.card.LinkAccountCard;
import com.baidu.dueros.data.response.card.TextCard;
import com.baidu.dueros.data.response.directive.audioplayer.AudioPlayerDirective;
import com.baidu.dueros.data.response.directive.audioplayer.Play;
import com.baidu.dueros.data.response.directive.pay.Buy;
import com.baidu.dueros.data.response.directive.pay.Charge;
import com.baidu.dueros.model.Request;
import com.baidu.dueros.model.Response;
import org.apache.commons.codec.binary.Base64;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.lang.System;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledThreadPoolExecutor;
......@@ -40,6 +56,8 @@ public class ResponseEncapsulation extends AudioPlayer {
private static final Logger logger = LoggerFactory.getLogger(ResponseEncapsulation.class);
private static final Boolean USE_CHARGE_ORDER = true;
public ResponseEncapsulation(HttpServletRequest request) throws IOException {
super(request);
String privateKey = "MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBANMWIYduiQZt0B7s\n" +
......@@ -78,6 +96,24 @@ public class ResponseEncapsulation extends AudioPlayer {
}
@Override
protected Response onBuyEvent(BuyEvent buyEvent) {
com.baidu.dueros.data.request.buy.event.Payload payload = buyEvent.getPayload();
String result = payload.getPurchaseResult().getPurchaseResult();
logger.info("此次支付结果:"+result+";msg: "+payload.getMessage());
if (result.equals("SUCCESS")) {
logger.info("支付成功");
return buildErrorResponse("恭喜您支付成功,开始体验吧");
}
return buildErrorResponse("哎呀,没有支付成功");
}
@Override
protected Response onLinkAccountSucceededEvent(LinkAccountSucceededEvent linkAccountSucceededEvent) {
logger.info("登录成功返回信息:{}",linkAccountSucceededEvent);
return buildErrorResponse("您已登录成功");
}
@Override
protected Response onInent(IntentRequest intentRequest) {
String userId = getCustomerId();
String timestamp = this.getRequest().getRequest().getTimestamp();
......@@ -122,12 +158,52 @@ public class ResponseEncapsulation extends AudioPlayer {
if (getIntent().getName().equals("buy")) {
String productName = getSlot("sys.wildcard-slot");
logger.info("用户要购买的作品名:"+productName);
if (USE_CHARGE_ORDER) {
// holder.setTimestamp(timestamp);
String accessToken;
if ((accessToken = getAccessToken()) != null) {
logger.info("未登录");
Card card = new LinkAccountCard();
// Card card = new TextCard("点击登录", "https://www.miaoshop.top/xiaodu/load?userId="+userId, "跳转链接");
Response response = buildErrorResponse("请在屏幕或是小度App上完成登录");
response.setCard(card);
return response;
}else {
int hasUserAlreadyOwned;
try {
hasUserAlreadyOwned = hasUserBuyTheThing(accessToken);
} catch (Exception e) {
logger.info("判断用户是否已购买操作出错:"+e.toString());
return new Response(new OutputSpeech(OutputSpeech.SpeechType.PlainText, "请在说一遍吧"));
}
switch (hasUserAlreadyOwned) {
case 1 : logger.info("用户已经购买");// 已购买如何处理
case 2 : {
logger.info("用户需要进行购买");
String sellerOrderId = "sgaggg"+new Random(47).nextInt(1000)+"aga"+new Random(47).nextInt(765355);
Charge chargeDirective = new Charge("0.01", sellerOrderId,
productName, productName+",这是个非常精彩的故事哦");
addDirective(chargeDirective);
OutputSpeech outputSpeech = new OutputSpeech(OutputSpeech.SpeechType.PlainText, "请到小度APP上去支付");
return new Response(outputSpeech);
}
case 3 : return new Response(new OutputSpeech(OutputSpeech.SpeechType.PlainText, "请在说一遍吧"));
case 4 : {
// token失效
Card card = new LinkAccountCard();
Response response = buildErrorResponse("请在屏幕或是小度App上完成登录");
response.setCard(card);
return response;
}
}
}
} else {
String productId = ProductManager.PRODUCT_ID;
Buy buy = new Buy(productId);
addDirective(buy);
OutputSpeech outputSpeech = new OutputSpeech(OutputSpeech.SpeechType.PlainText, "请到小度APP上去支付");
return new Response(outputSpeech);
}
}else {
AudioUrlAndText data = RequestTerminal.requestTerminate(userWord, userId);
if (data == null) {
......@@ -210,9 +286,10 @@ public class ResponseEncapsulation extends AudioPlayer {
case EXCEEDED_MAX_REPROMPTS: logger.info(EndMsg.CAN_NOT_UNDERSTAND);break;
}
// 向终端发送“退出”
OutputSpeech outputSpeech = new OutputSpeech(OutputSpeech.SpeechType.PlainText, EndMsg.BYE_BYE);
RequestTerminal.requestTerminate("退出", getCustomerId());
return new Response(outputSpeech);
// OutputSpeech outputSpeech = new OutputSpeech(OutputSpeech.SpeechType.PlainText, EndMsg.BYE_BYE);
// RequestTerminal.requestTerminate("退出", getCustomerId());
// return new Response(outputSpeech);
return new Response();
}
private void dealWithError(SessionEndedRequest request) {
......@@ -231,6 +308,7 @@ public class ResponseEncapsulation extends AudioPlayer {
private Play buildPlayDirective(String audioUrl, AudioPlayerDirective.PlayBehaviorType type) {
return new Play(type, audioUrl, 0);
}
/**
......@@ -312,8 +390,49 @@ public class ResponseEncapsulation extends AudioPlayer {
return requestStr.substring(asrWordBegin, asrWordEnd);
}
// private void payUseBuyOrder() {
// Buy buy = new Buy();
// SkillInfo
// private TokenHolder getCacheToken(String userId) {
// ConcurrentHashMap<String, TokenHolder> cache = LoadBySMS.getUserToken();
// return cache.get(userId);
// }
// private boolean isUserLoadAlready(TokenHolder holder) {
// return holder != null && holder.getAccessToken() != null;
// }
private Integer hasUserBuyTheThing(String accessToken) throws IOException {
Map<String, String> headers = new HashMap<>();
headers.put("App-Channel-Id", "JIAOYOUTIANXIA");
headers.put("Authorization", Constants.XIAOWU_API.BEARER+accessToken);
String responseStr = OkHttp3Utils.doGet(Constants.XIAOWU_API.GET_USER_INFO_BY_TOKEN, new HashMap<>(), headers);
GetUserInfoByToken userInfo = JSON.parseObject(responseStr, GetUserInfoByToken.class);
if (userInfo.getRetcode() == 0) {
logger.info("获取用户信息成功,"+userInfo);
// 1: buy; 2: not buy
return 1;
}else {
logger.warn("获取用户信息失败:"+userInfo);
// 若token失效刷新Token操作
// 3: 404,获取用户信息失败,提醒用户再说一遍
// 4: 401,403..让用户重新登录
Integer status = userInfo.getStatus();
if (status == 404) return 3;
else return 4;
}
}
private void getTokenByRefreshToken(String refreshToken, String userId) throws IOException {
Map<String, String> headers = new HashMap<>();
headers.put("App-Channel-Id", "JIAOYOUTIANXIA");
headers.put("Authorization", Constants.XIAOWU_API.BEARER+refreshToken);
String responseStr = OkHttp3Utils.doPost(Constants.XIAOWU_API.SDK_TOKEN, new HashMap<>(), headers);
GetTokenByRefreshToken responseInfo = JSON.parseObject(responseStr, GetTokenByRefreshToken.class);
if (responseInfo.getRetcode() == 0) {
logger.info("刷新Token成功:"+responseInfo);
// TokenHolder tokenHolder = getCacheToken(userId);
// tokenHolder.setAccessToken(responseInfo.getAccessToken());
// tokenHolder.setRefreshToken(responseInfo.getRefreshToken());
}else {
logger.info("刷新Token失败:"+responseInfo);
}
}
}
package ai.qiwu.baidu.xiaodu.service;
import ai.qiwu.baidu.xiaodu.common.TokenHolder;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.util.Iterator;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/**
* @author 苗权威
* @dateTime 19-7-18 下午4:01
*/
@Slf4j
//@Component
public class ScheduleTask {
// @Scheduled(fixedDelay = 120000, initialDelay = 120000)
// public void cleanUserToken() {
// Long bound = System.currentTimeMillis()-3600000;
// ConcurrentHashMap<String, TokenHolder> map = LoadBySMS.getUserToken();
// Iterator<Map.Entry<String, TokenHolder>> iterator = map.entrySet().iterator();
// iterator.forEachRemaining(e -> {
// if (Long.parseLong(e.getValue().getTimestamp()) <= bound) {
// log.info("清理用户{}的Token", e.getKey());
// iterator.remove();
// }
// });
// }
}
package ai.qiwu.baidu.xiaodu.service.productManager;
import ai.qiwu.baidu.xiaodu.common.Constants;
import ai.qiwu.baidu.xiaodu.pojo.product.*;
import ai.qiwu.baidu.xiaodu.pojo.product.response.CreateProductResponse;
import ai.qiwu.baidu.xiaodu.pojo.product.response.GetTokenResponse;
import ai.qiwu.baidu.xiaodu.pojo.product.response.PublishRequestBody;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import okhttp3.*;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
/**
* @author 苗权威
* @dateTime 19-7-13 下午2:20
*/
@Slf4j
public class ProductManager {
public static String TOKEN = "wZ%2F0TD2CqSvyheWppX%2F8ftL8DKycbj2eKYyQPHS8SuOMu%2By0faQCIL%2Be7nEDKZnC8sjHAtYwaVeQS94pwWROJuUbI%2BkhClToo04jJ9AGUTj4dbSCdnICgJjPDTgb3z30X%2BHlxYXXIyOQhuMQIwm%2BHQ%3D%3D";
public static String PRODUCT_ID = "";
private static String getToken() throws IOException {
OkHttpClient client = new OkHttpClient();
HttpUrl httpUrl = HttpUrl.parse(Constants.ManageProduct.GET_TOKEN)
.newBuilder()
.addQueryParameter("skillId", "3f1ca0e0-5b2d-0a11-7472-b27eaae0fca3")
.build();
Request request = new Request.Builder()
.url(httpUrl).get().build();
Response response = client.newCall(request).execute();
log.info("请求Token返回{}",response.toString());
try (ResponseBody responseBody = response.body()){
String responseContent = responseBody.string();
log.info("请求Token返回字符串{}",response.toString());
GetTokenResponse tokenResponse = JSON.parseObject(responseContent, GetTokenResponse.class);
log.info("请求Token返回Information:{}",tokenResponse);
if (tokenResponse.getStatus() == 0) {
log.info("获取Token成功, 时限:"+tokenResponse.getData().getExpireSeconds());
return tokenResponse.getData().getToken();
}
return null;
}
}
public static String createProduct(String token) throws IOException {
Product product = buildProduct();
String jsonStr = JSON.toJSONString(product);
log.info("商品JSON字符串{}",jsonStr);
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url(Constants.ManageProduct.CREATE_PRODUCT)
.addHeader("Authorization", token)
.post(RequestBody.create(
MediaType.parse("application/json; charset=utf-8"), jsonStr))
.build();
Response response = client.newCall(request).execute();
try (ResponseBody responseBody = response.body()){
String responseContent = responseBody.string();
log.info("创建商品结果:{}",responseContent);
CreateProductResponse productResponse = JSON.parseObject(responseContent, CreateProductResponse.class);
log.info("创建商品结果返回的JSON解析结果{}",productResponse);
if (productResponse.getStatus() == 0) {
log.info("创建商品成功");
return productResponse.getData().getProductID();
}
log.info("创建商品失败");
return null;
}
}
public static void publishProduct() throws IOException {
// String token = getToken();
// if (token == null) {
// log.info("获取Token失败");
// return;
// }
String productId = createProduct(TOKEN);
if (productId == null) {
return;
}
//LV_ZHOU_ID = productId;
log.info("成功获取到已绿洲的商品ID:"+productId);
PublishRequestBody requestBody = new PublishRequestBody();
requestBody.setProductId(productId);
String requestBodyJsonStr = JSON.toJSONString(requestBody);
log.info("发布商品请求提JSON解析结果{}",requestBodyJsonStr);
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url(Constants.ManageProduct.CREATE_PRODUCT)
.addHeader("Authorization", TOKEN)
.put(RequestBody.create(
MediaType.parse("application/json; charset=utf-8"), requestBodyJsonStr))
.build();
Response response = client.newCall(request).execute();
try (ResponseBody responseBody = response.body()){
String responseContent = responseBody.string();
log.info("发布商品结果:{}",responseContent);
CreateProductResponse productResponse = JSON.parseObject(responseContent, CreateProductResponse.class);
log.info("发布商品结果返回的JSON解析结果{}",productResponse);
if (productResponse.getStatus() == 0) {
log.info("发布商品成功");
PRODUCT_ID = productResponse.getData().getProductID();
return;
}
log.info("发布商品失败");
}
}
private static Product buildProduct() {
Product product = new Product();
product.setVersion("1.0");
product.setType("ENTITLEMENT");
product.setReferenceName("绿洲");
PublishingInformation info = new PublishingInformation();
info.setName("绿洲");
info.setSmallIconUri("https://www.miaoshop.top/xiaodu/small.jpg");
info.setLargeIconUri("https://www.miaoshop.top/xiaodu/big.jpg");
info.setSummary("绿洲简介:这个是超好玩的游戏");
info.setCategory("冒险");
info.setDescription("介绍:绿洲是我司精心开发的冒险游戏");
List<String> examplePhrases = new ArrayList<>();
examplePhrases.add("购买提示1");
examplePhrases.add("购买提示2");
examplePhrases.add("购买提示3");
info.setExamplePhrases(examplePhrases);
List<String> keywords = new ArrayList<>();
keywords.add("关键字1");
keywords.add("关键字2");
keywords.add("关键字3");
info.setKeywords(keywords);
CustomProductPrompts custom = new CustomProductPrompts();
custom.setBoughtCardDescription("对话流购买卡片上展示提示");
custom.setPurchasePromptDescription("您正在进行作品的购买");
info.setCustomProductPrompts(custom);
Pricing pricing = new Pricing();
pricing.setOriginalPrice(100);
pricing.setPrice(1);
info.setPricing(pricing);
info.setSkillId("3f1ca0e0-5b2d-0a11-7472-b27eaae0fca3");
info.setPurchasableState("PURCHASABLE");
product.setPublishingInformation(info);
return product;
}
}
#logging.path=/usr/mqw/logs/xiaodu
#logging.level.root = info
#spring.output.ansi.enabled=detect
spring.thymeleaf.mode=HTML
spring.thymeleaf.encoding=UTF-8
spring.thymeleaf.servlet.content-type=text/html
#开发时关闭缓存,不然没法看到实时页面
spring.thymeleaf.cache=false
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>重定向</title>
<script type="text/javascript">
window.location.href = "https://openapi.baidu.com/oauth/2.0/authorize?response_type=code&client_id=dSG525LMr887uLlfAyK1C1ag&redirect_uri=https://www.miaoshop.top/xiaodu/baidu/code&confirm_login=1&state=mqw";
</script>
</head>
<body>
<span>登录成功,请返回</span>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>登录</title>
<script type="text/javascript">
var first = true;
if (first) {
first = false;
function getCaptcha() {
var phoneNum = document.getElementById("phone").value;
// $.get('/xiaodu/captcha?phoneNumber='+phoneNum);
var ajaxObj = new XMLHttpRequest();
ajaxObj.open('get', '/xiaodu/captcha?phoneNumber='+phoneNum);
ajaxObj.send();
}
}
</script>
</head>
<body>
<form action="#" th:action="@{/xiaodu/token}" th:object="${userInfo}" method="post">
<input th:field="*{userId}" th:hidden="true" th:default="*{userId}">
<p>手机号:<input id="phone" type="text" th:field="*{phoneNumber}"/>
<input type="button" th:onclick="'javascript:getCaptcha();'" th:value="点击获取验证码"/></p>
<p>填写验证码:<input type="text" th:field="*{captcha}"/></p>
<input type="submit" th:value="点击登录"/>
</form>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Title</title>
</head>
<body>
<span>登录失败,请返回</span>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>重定向</title>
<!--<script LANGUAGE="JavaScript">-->
<!--var code = document.getElementById("code").value;-->
<!--var state = document.getElementById("state").value;-->
<!--if (typeof state == "undefined" || state == null || state === "") {-->
<!--alert("NO state");-->
<!--Window.location.href="https://xiaodu-dbp.baidu.com/saiya/auth/3428011e7f55ec4c10b2da1b00a1675b?code="+code;-->
<!--} else {-->
<!--alert("state:"+state);-->
<!--Window.location.href="https://xiaodu-dbp.baidu.com/saiya/auth/3428011e7f55ec4c10b2da1b00a1675b?state="+state+"&code="+code;-->
<!--}-->
<!--</script>>-->
</head>
<body>
<span>登录成功,请返回</span>
<!--<input type="text" id="state" th:hidden="true" th:value="*{state}"/>-->
<!--<input type="text" id="code" th:hidden="true" th:value="*{code}"/>-->
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>重定向</title>
<script type="text/javascript">
// function returnToken() {
// var state = document.getElementById("state").value;
// var code = document.getElementById("code").value;
// var uri = "https://xiaodu-dbp.baidu.com/saiya/auth/3428011e7f55ec4c10b2da1b00a1675b?";
// if (state === undefined || state == null || state === "") {
// alert("state is none, code:"+code);
// uri = uri+"code="+code
// // window.location.href = "https://xiaodu-dbp.baidu.com/saiya/auth/3428011e7f55ec4c10b2da1b00a1675b?code="+code;
// } else {
// alert("state:"+ state);
// uri = uri + "state="+state+"&code="+code;
// // window.location.href = "https://xiaodu-dbp.baidu.com/saiya/auth/3428011e7f55ec4c10b2da1b00a1675b?state="+state+"&code="+code;
// }
// var ajaxObj = new XMLHttpRequest();
// ajaxObj.open('get', uri);
// ajaxObj.onreadystatechange = function () {
// alert(ajaxObj.responseText);
// };
// ajaxObj.send();
// }
var state = document.getElementById("state").value;
var code = document.getElementById("code").value;
var uri = "https://xiaodu-dbp.baidu.com/saiya/auth/3428011e7f55ec4c10b2da1b00a1675b?";
if (state === undefined || state == null || state === "") {
uri = uri+"code="+code
} else {
uri = uri + "state="+state+"&code="+code;
}
window.location.href = uri;
</script>
</head>
<body>
<span>登录成功,请返回</span>
<input type="text" id="state" th:value="*{state}"/>
<input type="text" id="code" th:value="*{code}"/>
<!--<input type="button" th:onclick="'javascript:returnToken();'" th:value="点击发送验证码给小度"/>-->
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>登录</title>
<script type="text/javascript">
var first = true;
if (first) {
first = false;
function getCaptcha() {
var phoneNum = document.getElementById("phone").value;
var ajaxObj = new XMLHttpRequest();
ajaxObj.open('get', '/xiaodu/security/captcha?phoneNumber='+phoneNum);
ajaxObj.send();
}
}
function getToken() {
var state = document.getElementById("state").value;
var phoneNum = document.getElementById("phone").value;
var captcha = document.getElementById("captcha").value;
// alert("phone:"+phoneNum+",captcha:"+captcha);
var ajaxObj = new XMLHttpRequest();
//var uri = '/xiaodu/security/token?phoneNumber='+phoneNum+'&captcha='+captcha;
ajaxObj.open('get', '/xiaodu/security/token?phoneNumber='+phoneNum+'&captcha='+captcha);
ajaxObj.send();
ajaxObj.onreadystatechange = function () {
if (ajaxObj.readyState === 4 && ajaxObj.status === 200) {
if (ajaxObj.responseText === "1") {
// alert(1);
var redirectUri = "https://xiaodu-dbp.baidu.com/saiya/auth/3428011e7f55ec4c10b2da1b00a1675b?code="+phoneNum;
if (state !== undefined && state !== null && state !== "") {
redirectUri = redirectUri + "&state"+state;
}
window.location.href = redirectUri;
}
}
}
}
</script>
</head>
<body>
<input type="text" id="state" th:hidden="true" th:default="*{userInfo.state}"/>
<p>手机号:<input id="phone" type="text"/>
<input type="button" th:onclick="'javascript:getCaptcha();'" th:value="点击获取验证码"/></p>
<p>填写验证码:<input id="captcha" type="text"/></p>
<input type="button" onclick="getToken()" th:value="点击登录"/>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment