mirror of
https://gitee.com/dromara/sa-token.git
synced 2025-06-28 13:34:18 +08:00
更换qq群链接
This commit is contained in:
parent
4d54e13cbc
commit
3f6a753cdd
@ -134,8 +134,7 @@ StpUtil.switchTo(10044); // 将当前会话身份临时切换为其它账号
|
||||
|
||||
|
||||
## 交流群
|
||||
QQ交流群:1群:1002350610 (已满) 、
|
||||
2群:614714762 [点击加入](https://jq.qq.com/?_wv=1027&k=b759RZrL)
|
||||
QQ交流群:496757342 [点击加入](https://jq.qq.com/?_wv=1027&k=WNggbsFe)
|
||||
|
||||
微信交流群:
|
||||
|
||||
|
@ -151,7 +151,7 @@
|
||||
}
|
||||
</script>
|
||||
<script src="https://unpkg.com/docsify@4.9.4/lib/docsify.min.js"></script>
|
||||
<script src="https://unpkg.com/docsify-copy-code@2.1.0/dist/docsify-copy-code.min.js"></script>
|
||||
<script src="lib/docsify-copy-code.min.js"></script>
|
||||
<script src="lib/prism-java.min.js"></script>
|
||||
<!-- 搜索框 -->
|
||||
<script src="lib/search.min.js"></script>
|
||||
|
@ -152,7 +152,7 @@
|
||||
}
|
||||
</script>
|
||||
<script src="https://unpkg.zhimg.com/docsify@4.9.4/lib/docsify.min.js"></script>
|
||||
<script src="https://unpkg.zhimg.com/docsify-copy-code@2.1.0/dist/docsify-copy-code.min.js"></script>
|
||||
<script src="lib/docsify-copy-code.min.js"></script>
|
||||
<script src="lib/prism-java.min.js"></script>
|
||||
<!-- 搜索框 -->
|
||||
<script src="lib/search.min.js"></script>
|
||||
|
9
sa-token-doc/doc/lib/docsify-copy-code.min.js
vendored
Normal file
9
sa-token-doc/doc/lib/docsify-copy-code.min.js
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
/*!
|
||||
* docsify-copy-code
|
||||
* v2.1.0
|
||||
* https://github.com/jperasmus/docsify-copy-code
|
||||
* (c) 2017-2019 JP Erasmus <jperasmus11@gmail.com>
|
||||
* MIT license
|
||||
*/
|
||||
!function(){"use strict";function r(o){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o})(o)}!function(o,e){void 0===e&&(e={});var t=e.insertAt;if(o&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],c=document.createElement("style");c.type="text/css","top"===t&&n.firstChild?n.insertBefore(c,n.firstChild):n.appendChild(c),c.styleSheet?c.styleSheet.cssText=o:c.appendChild(document.createTextNode(o))}}(".docsify-copy-code-button,.docsify-copy-code-button span{cursor:pointer;transition:all .25s ease}.docsify-copy-code-button{position:absolute;z-index:1;top:0;right:0;overflow:visible;padding:.65em .8em;border:0;border-radius:0;outline:0;font-size:1em;background:grey;background:var(--theme-color,grey);color:#fff;opacity:0}.docsify-copy-code-button span{border-radius:3px;background:inherit;pointer-events:none}.docsify-copy-code-button .error,.docsify-copy-code-button .success{position:absolute;z-index:-100;top:50%;left:0;padding:.5em .65em;font-size:.825em;opacity:0;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.docsify-copy-code-button.error .error,.docsify-copy-code-button.success .success{opacity:1;-webkit-transform:translate(-115%,-50%);transform:translate(-115%,-50%)}.docsify-copy-code-button:focus,pre:hover .docsify-copy-code-button{opacity:1}"),document.querySelector('link[href*="docsify-copy-code"]')&&console.warn("[Deprecation] Link to external docsify-copy-code stylesheet is no longer necessary."),window.DocsifyCopyCodePlugin={init:function(){return function(o,e){o.ready(function(){console.warn("[Deprecation] Manually initializing docsify-copy-code using window.DocsifyCopyCodePlugin.init() is no longer necessary.")})}}},window.$docsify=window.$docsify||{},window.$docsify.plugins=[function(o,s){o.doneEach(function(){var o=Array.apply(null,document.querySelectorAll("pre[data-lang]")),c={buttonText:"Copy to clipboard",errorText:"Error",successText:"Copied"};s.config.copyCode&&Object.keys(c).forEach(function(t){var n=s.config.copyCode[t];"string"==typeof n?c[t]=n:"object"===r(n)&&Object.keys(n).some(function(o){var e=-1<location.href.indexOf(o);return c[t]=e?n[o]:c[t],e})});var e=['<button class="docsify-copy-code-button">','<span class="label">'.concat(c.buttonText,"</span>"),'<span class="error">'.concat(c.errorText,"</span>"),'<span class="success">'.concat(c.successText,"</span>"),"</button>"].join("");o.forEach(function(o){o.insertAdjacentHTML("beforeend",e)})}),o.mounted(function(){document.querySelector(".content").addEventListener("click",function(o){if(o.target.classList.contains("docsify-copy-code-button")){var e="BUTTON"===o.target.tagName?o.target:o.target.parentNode,t=document.createRange(),n=e.parentNode.querySelector("code"),c=window.getSelection();t.selectNode(n),c.removeAllRanges(),c.addRange(t);try{document.execCommand("copy")&&(e.classList.add("success"),setTimeout(function(){e.classList.remove("success")},1e3))}catch(o){console.error("docsify-copy-code: ".concat(o)),e.classList.add("error"),setTimeout(function(){e.classList.remove("error")},1e3)}"function"==typeof(c=window.getSelection()).removeRange?c.removeRange(t):"function"==typeof c.removeAllRanges&&c.removeAllRanges()}})})}].concat(window.$docsify.plugins||[])}();
|
||||
//# sourceMappingURL2=docsify-copy-code.min.js.map
|
@ -27,7 +27,7 @@ var myDocsifyPlugin = function(hook, vm) {
|
||||
'<footer>',
|
||||
'<span>发现错误? 您可以在 <a href="' + url + '" target="_blank">Gitee</a> 或 <a href="' + url2 +
|
||||
'" target="_blank">GitHub</a> 帮助我们完善此页文档!</span>',
|
||||
'或 <a href="https://jq.qq.com/?_wv=1027&k=b759RZrL" target="_blank">加入QQ群</a> 交流反馈',
|
||||
'或 <a href="https://jq.qq.com/?_wv=1027&k=ceibbMFr" target="_blank">加入QQ群</a> 交流反馈',
|
||||
'</footer>'
|
||||
].join('');
|
||||
return html + footer;
|
||||
|
2
sa-token-doc/doc/lib/docsify-tabs.min.js
vendored
2
sa-token-doc/doc/lib/docsify-tabs.min.js
vendored
File diff suppressed because one or more lines are too long
@ -32,13 +32,13 @@ public class SsoServerController {
|
||||
``` java
|
||||
// 配置SSO相关参数
|
||||
@Autowired
|
||||
private void configSso(SaTokenConfig cfg) {
|
||||
private void configSso(SaSsoConfig sso) {
|
||||
// 自定义API地址
|
||||
SaSsoConsts.Api.ssoAuth = "/sso/auth2";
|
||||
// ...
|
||||
|
||||
// SSO 相关配置
|
||||
cfg.sso.setXxx ... ;
|
||||
sso.setXxx ... ;
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -81,7 +81,7 @@ if(res.code == 401) {
|
||||
|
||||
``` java
|
||||
// 配置:未登录时返回的View
|
||||
cfg.sso.setNotLoginView(() -> {
|
||||
sso.setNotLoginView(() -> {
|
||||
return new ModelAndView("xxx.html");
|
||||
})
|
||||
```
|
||||
|
@ -79,9 +79,9 @@ public class SsoServerController {
|
||||
* 配置SSO相关参数
|
||||
*/
|
||||
@Autowired
|
||||
private void configSso(SaTokenConfig cfg) {
|
||||
private void configSso(SaSsoConfig sso) {
|
||||
// 配置:未登录时返回的View
|
||||
cfg.sso.setNotLoginView(() -> {
|
||||
sso.setNotLoginView(() -> {
|
||||
String msg = "当前会话在SSO-Server端尚未登录,请先访问"
|
||||
+ "<a href='/sso/doLogin?name=sa&pwd=123456' target='_blank'> doLogin登录 </a>"
|
||||
+ "进行登录之后,刷新页面开始授权";
|
||||
@ -89,7 +89,7 @@ public class SsoServerController {
|
||||
});
|
||||
|
||||
// 配置:登录处理函数
|
||||
cfg.sso.setDoLoginHandle((name, pwd) -> {
|
||||
sso.setDoLoginHandle((name, pwd) -> {
|
||||
// 此处仅做模拟登录,真实环境应该查询数据进行登录
|
||||
if("sa".equals(name) && "123456".equals(pwd)) {
|
||||
StpUtil.login(10001);
|
||||
@ -99,7 +99,7 @@ public class SsoServerController {
|
||||
});
|
||||
|
||||
// 配置 Http 请求处理器 (在模式三的单点注销功能下用到,如不需要可以注释掉)
|
||||
cfg.sso.setSendHttp(url -> {
|
||||
sso.setSendHttp(url -> {
|
||||
try {
|
||||
// 发起 http 请求
|
||||
System.out.println("发起请求:" + url);
|
||||
|
@ -109,8 +109,8 @@ public class SsoClientController {
|
||||
// SSO-Client端:首页
|
||||
@RequestMapping("/")
|
||||
public String index() {
|
||||
String authUrl = SaManager.getConfig().getSso().getAuthUrl();
|
||||
String solUrl = SaManager.getConfig().getSso().getSloUrl();
|
||||
String authUrl = SaSsoManager.getConfig().getAuthUrl();
|
||||
String solUrl = SaSsoManager.getConfig().getSloUrl();
|
||||
String str = "<h2>Sa-Token SSO-Client 应用端</h2>" +
|
||||
"<p>当前会话是否登录:" + StpUtil.isLogin() + "</p>" +
|
||||
"<p><a href=\"javascript:location.href='" + authUrl + "?mode=simple&redirect=' + encodeURIComponent(location.href);\">登录</a> " +
|
||||
|
@ -36,11 +36,11 @@
|
||||
``` java
|
||||
// 配置SSO相关参数
|
||||
@Autowired
|
||||
private void configSso(SaTokenConfig cfg) {
|
||||
private void configSso(SaSsoConfig sso) {
|
||||
// ... 其他代码
|
||||
|
||||
// 配置 Http 请求处理器
|
||||
cfg.sso.setSendHttp(url -> {
|
||||
sso.setSendHttp(url -> {
|
||||
System.out.println("发起请求:" + url);
|
||||
return OkHttps.sync(url).get().getBody().toString();
|
||||
});
|
||||
|
@ -79,6 +79,17 @@ public class SaTokenConfigure {
|
||||
- 由于过滤器中抛出的异常不进入全局异常处理,所以你必须提供`[异常处理函数]`来处理`[认证函数]`里抛出的异常
|
||||
- 在`[异常处理函数]`里的返回值,将作为字符串输出到前端,如果需要定制化返回数据,请注意其中的格式转换
|
||||
|
||||
改写 `setError` 函数的响应格式示例:
|
||||
``` java
|
||||
.setError(e -> {
|
||||
// 设置响应头
|
||||
SaHolder.getResponse().setHeader("Content-Type", "application/json;charset=UTF-8");
|
||||
// 使用封装的 JSON 工具类转换数据格式
|
||||
return JSONUtil.toJsonStr( SaResult.error(e.getMessage()) );
|
||||
})
|
||||
```
|
||||
JSON 工具类可参考:[Hutool-Json](https://hutool.cn/docs/#/json/JSONUtil)
|
||||
|
||||
|
||||
### 在 WebFlux 中注册过滤器
|
||||
`Spring WebFlux`中不提供拦截器机制,因此若你的项目需要路由鉴权功能,过滤器是你唯一的选择,在`Spring WebFlux`注册过滤器的流程与上述流程几乎完全一致,
|
||||
|
@ -87,8 +87,8 @@
|
||||
</h4>
|
||||
<div class="wx-qr-box">
|
||||
<div class="qr-item">
|
||||
<img class="wx-qr" src="https://oss.dev33.cn/sa-token/qq-group-2.png" >
|
||||
<p style="">QQ交流群: 614714762 <a href="https://jq.qq.com/?_wv=1027&k=b759RZrL" target="_blank">点击加入</a></p>
|
||||
<img class="wx-qr" src="https://oss.dev33.cn/sa-token/qq-group-3.png" >
|
||||
<p style="">QQ交流群: 496757342 <a href="https://jq.qq.com/?_wv=1027&k=ceibbMFr" target="_blank">点击加入</a></p>
|
||||
</div>
|
||||
<div class="qr-item">
|
||||
<img class="wx-qr" src="https://oss.dev33.cn/sa-token/wx-qr-300.png" >
|
||||
@ -318,7 +318,7 @@
|
||||
<h3>联系我们</h3>
|
||||
<ul class="list-unstyle">
|
||||
<!-- <li>电话:<a href="tel:123;">123</a></li> -->
|
||||
<li>QQ群 :<a href="https://jq.qq.com/?_wv=1027&k=b759RZrL" target="_blank">614714762</a></li>
|
||||
<li>QQ群 :<a href="https://jq.qq.com/?_wv=1027&k=ceibbMFr" target="_blank">496757342</a></li>
|
||||
<li>邮箱:<a href="javascript: alert('暂无');">暂无</a></li>
|
||||
<li>联系:<a href="javascript: alert('暂无');">暂无</a></li>
|
||||
</ul>
|
||||
|
Loading…
Reference in New Issue
Block a user