Compare commits

..

4 Commits

Author SHA1 Message Date
dependabot[bot] eceb5f1c05 build(deps): bump org.springdoc:springdoc-openapi-starter-webmvc-ui
Bumps [org.springdoc:springdoc-openapi-starter-webmvc-ui](https://github.com/springdoc/springdoc-openapi) from 2.8.8 to 3.0.3.
- [Release notes](https://github.com/springdoc/springdoc-openapi/releases)
- [Changelog](https://github.com/springdoc/springdoc-openapi/blob/v3.0.3/CHANGELOG.md)
- [Commits](https://github.com/springdoc/springdoc-openapi/compare/v2.8.8...v3.0.3)

---
updated-dependencies:
- dependency-name: org.springdoc:springdoc-openapi-starter-webmvc-ui
  dependency-version: 3.0.3
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-09 08:18:51 +00:00
huangping 327e5e2b91 chore: release v0.1.0
deploy / build-and-deploy (push) Waiting to run
2026-06-09 16:17:48 +08:00
huangping 7fc1fa3727 feat: add demo mode for prototype deployment (no backend) 2026-06-09 09:45:10 +08:00
huangping 4c2db92da4 fix: set vite base path for /authorization-sdk/ deployment 2026-06-09 09:43:21 +08:00
3 changed files with 18 additions and 3 deletions
+1 -1
View File
@@ -59,7 +59,7 @@
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.8.8</version>
<version>3.0.3</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
+16 -2
View File
@@ -9,7 +9,10 @@ function decodeJwtPayload(token) {
const parts = token.split(".");
if (parts.length !== 3) return null;
const payload = parts[1];
const decoded = atob(payload.replace(/-/g, "+").replace(/_/g, "/"));
const latin1 = atob(payload.replace(/-/g, "+").replace(/_/g, "/"));
// atob 返回 Latin-1 编码,需转为 UTF-8 才能正确解析中文
const bytes = Uint8Array.from(latin1, (c) => c.charCodeAt(0));
const decoded = new TextDecoder().decode(bytes);
return JSON.parse(decoded);
} catch {
return null;
@@ -55,7 +58,18 @@ export const useAuthStore = defineStore("auth", {
},
actions: {
async login(username, password) {
const { data } = await axios.post("/api/v1/auth/login", { username, password });
let data;
try {
const res = await axios.post("/api/v1/auth/login", { username, password });
data = res.data;
} catch {
// Demo mode: no backend available, use mock login
if (username === "admin" || username === "demo") {
data = { token: "demo-token-xxx", displayName: "管理员", roles: ["SYS_ADMIN"], permissions: ["*"] };
} else {
throw new Error("无法连接登录接口(原型模式无后端)");
}
}
this.token = data.token;
this.displayName = data.displayName || username;
this.roles = data.roles || [];
+1
View File
@@ -3,6 +3,7 @@ import vue from "@vitejs/plugin-vue";
export default defineConfig({
plugins: [vue()],
base: "/authorization-sdk/",
server: {
port: 5173,
proxy: {