Skip to content

Commit

Permalink
Merge pull request surmon-china#59 from surmon-china/develop
Browse files Browse the repository at this point in the history
feat: v3.4.2
  • Loading branch information
surmon-china authored Dec 20, 2020
2 parents ad9b6ca + 4d8b902 commit 5f36284
Show file tree
Hide file tree
Showing 45 changed files with 2,412 additions and 1,854 deletions.
100 changes: 100 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
{
"root": true,
"ignorePatterns": [
"projects/**/*"
],
"overrides": [
{
"files": [
"*.ts"
],
"parserOptions": {
"project": [
"tsconfig.json",
"e2e/tsconfig.json"
],
"createDefaultProgram": true
},
"extends": [
"plugin:@angular-eslint/ng-cli-compat",
"plugin:@angular-eslint/ng-cli-compat--formatting-add-on",
"plugin:@angular-eslint/template/process-inline-templates",
"plugin:@typescript-eslint/recommended"
],
"rules": {
"no-shadow": 0,
"no-console": 0,
"no-unused-expressions": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-unused-expressions": 0,
"@typescript-eslint/no-empty-function": 0,
"@typescript-eslint/naming-convention": 0,
"@typescript-eslint/member-ordering": 0,
"@typescript-eslint/explicit-module-boundary-types": 0,
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": [
"sa",
"app",
"page",
"box"
],
"style": "kebab-case"
}
],
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": [
"sa",
"app",
"page"
],
"style": "camelCase"
}
],
"@angular-eslint/no-output-native": "off",
"@typescript-eslint/explicit-member-accessibility": [
"off",
{
"accessibility": "explicit"
}
],
"@typescript-eslint/no-inferrable-types": [
"off",
{
"ignoreParameters": true
}
],
"arrow-parens": [
"off",
"always"
],
"id-blacklist": "off",
"id-match": "off",
"import/order": "off",
"max-len": [
"error",
{
"code": 160
}
],
"no-underscore-dangle": "off"
}
},
{
"files": [
"*.html"
],
"extends": [
"plugin:@angular-eslint/template/recommended"
],
"rules": {
"attr-lowercase": 0
}
}
]
}
10 changes: 7 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@

### TODO
- TSLint to ESLint
# Changelog
All notable changes to this project will be documented in this file.

## CHANGELOG
### v3.4.2
- Upgrade deps
- Update CI
- TSLint to ESLint
- Remove GitHub/Music/Bilibili/Wallpaper action for option page

### v3.4.0
- Improve archive page toolbar
Expand Down
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The project forked from [ng2-admin](https://akveo.github.io/ng2-admin/). 项目

**其他相关项目:**
- **RESTful API service:** [nodepress](https://github.com/surmon-china/nodepress) powered by [nestjs](https://github.com/nestjs/nest)
- **web client for user:** [surmon.me](https://github.com/surmon-china/surmon.me) powered by [Nuxt.js](https://github.com/nuxt/nuxt.js)
- **web client for user:** [surmon.me](https://github.com/surmon-china/surmon.me) powered by [Vue (3)](https://vuejs.org/)
- **native app client:** [surmon.me.native](https://github.com/surmon-china/surmon.me.native) powered by [react-native](https://github.com/facebook/react-native)

**更新记录:[CHANGELOG.md](https://github.com/surmon-china/angular-admin/blob/master/CHANGELOG.md#changelog)**
Expand All @@ -39,20 +39,25 @@ The project forked from [ng2-admin](https://akveo.github.io/ng2-admin/). 项目

```bash
# install dependencies
npm ci
yarn

# serve with hot reload at localhost:4200
npm run dev
yarn dev

# lint
npm run lint
yarn lint

# test
npm run test
npm run e2e
yarn test
yarn e2e

# build
npm run build
yarn build

# CD (local build)
yarn local:build:tar
# CD (remote deploy)
yarn local:deploy
```

## Actions setup
Expand Down
13 changes: 4 additions & 9 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
Expand Down Expand Up @@ -104,15 +103,11 @@
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"builder": "@angular-eslint/builder:lint",
"options": {
"tsConfig": [
"tsconfig.app.json",
"tsconfig.spec.json",
"e2e/tsconfig.json"
],
"exclude": [
"**/node_modules/**"
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html"
]
}
},
Expand Down
75 changes: 42 additions & 33 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-admin",
"version": "3.4.0",
"version": "3.4.2",
"author": {
"name": "Surmon",
"email": "[email protected]",
Expand Down Expand Up @@ -34,55 +34,54 @@
"npm": ">= 5"
},
"dependencies": {
"@angular/animations": "~10.1.6",
"@angular/common": "~10.1.6",
"@angular/compiler": "~10.1.6",
"@angular/core": "~10.1.6",
"@angular/forms": "~10.1.6",
"@angular/animations": "~11.0.5",
"@angular/common": "~11.0.5",
"@angular/compiler": "~11.0.5",
"@angular/core": "~11.0.5",
"@angular/forms": "~11.0.5",
"@angular/http": "^7.2.16",
"@angular/platform-browser": "~10.1.6",
"@angular/platform-browser-dynamic": "~10.1.6",
"@angular/router": "~10.1.6",
"@ngx-loading-bar/core": "^5.1.0",
"@ngx-loading-bar/http-client": "^5.1.0",
"ali-oss": "^6.11.2",
"@angular/platform-browser": "~11.0.5",
"@angular/platform-browser-dynamic": "~11.0.5",
"@angular/router": "~11.0.5",
"@ngx-loading-bar/core": "^5.1.1",
"@ngx-loading-bar/http-client": "^5.1.1",
"ali-oss": "^6.12.0",
"angular2-notifications": "^9.0.0",
"animate.css": "^4.1.1",
"bootstrap": "^4.5.3",
"codemirror": "^5.58.1",
"core-js": "^3.6.5",
"codemirror": "^5.59.0",
"core-js": "^3.8.1",
"gravatar": "^1.8.1",
"highlight.js": "^10.2.1",
"highlight.js": "^10.4.1",
"ionicons": "^5.2.3",
"js-base64": "^3.5.2",
"js-base64": "^3.6.0",
"loaders.css": "^0.1.2",
"lodash": "^4.17.20",
"marked": "^1.2.0",
"ngx-bootstrap": "^6.1.0",
"marked": "^1.2.7",
"ngx-bootstrap": "^6.2.0",
"normalize.css": "^8.0.1",
"rxjs": "~6.6.3",
"rxjs-compat": "^6.6.3",
"sass-loader": "^10.0.3",
"sass-loader": "^10.1.0",
"store.js": "^1.0.4",
"tslib": "^2.0.3",
"ua-parser-js": "^0.7.22",
"zone.js": "~0.11.2"
"ua-parser-js": "^0.7.23",
"zone.js": "~0.11.3"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.1001.7",
"@angular/cli": "~10.1.7",
"@angular/compiler-cli": "~10.1.6",
"@angular/language-service": "~10.1.6",
"@angular-devkit/build-angular": "~0.1100.5",
"@angular/cli": "~11.0.5",
"@angular/compiler-cli": "~11.0.5",
"@angular/language-service": "~11.0.5",
"@types/ali-oss": "^6.0.5",
"@types/codemirror": "^0.0.98",
"@types/codemirror": "^0.0.102",
"@types/gravatar": "^1.8.1",
"@types/jasmine": "~3.5.14",
"@types/jasmine": "~3.6.2",
"@types/jasminewd2": "~2.0.8",
"@types/js-base64": "^3.0.0",
"@types/node": "~14.11.10",
"@types/node": "~14.14.14",
"@types/systemjs": "^6.1.0",
"@types/ua-parser-js": "^0.7.33",
"codelyzer": "^6.0.1",
"@types/ua-parser-js": "^0.7.35",
"jasmine-core": "~3.6.0",
"jasmine-spec-reporter": "~6.0.0",
"karma": "~5.2.3",
Expand All @@ -91,8 +90,18 @@
"karma-jasmine": "~4.0.1",
"karma-jasmine-html-reporter": "^1.5.4",
"protractor": "~7.0.0",
"ts-node": "~9.0.0",
"tslint": "~6.1.0",
"typescript": "~4.0.3"
"ts-node": "~9.1.1",
"typescript": "~4.0.5",
"eslint": "^7.16.0",
"eslint-plugin-import": "2.22.1",
"eslint-plugin-jsdoc": "30.7.9",
"eslint-plugin-prefer-arrow": "1.2.2",
"@angular-eslint/builder": "0.8.0-beta.6",
"@angular-eslint/eslint-plugin": "0.8.0-beta.6",
"@angular-eslint/eslint-plugin-template": "0.8.0-beta.6",
"@angular-eslint/schematics": "^0.8.0-beta.6",
"@angular-eslint/template-parser": "0.8.0-beta.6",
"@typescript-eslint/eslint-plugin": "4.10.0",
"@typescript-eslint/parser": "4.10.0"
}
}
Binary file modified product/www.tar.gz
Binary file not shown.
12 changes: 6 additions & 6 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,17 @@ export class AppComponent implements AfterViewInit, OnInit {
});

// 路由拦截器
this.router.events.subscribe(event => {
this.router.events.subscribe(() => {
const url: string = this.router.url;
// 如果发生 非首页或登陆页 的跳转事件,则执行 Token 全面检查
if (!isIndexPage(url) && !isAuthPage(url) && !this.tokenService.isTokenValid()) {
this.remiveTokenToLogin();
this.removeTokenToLogin();
}
});
}

// 删除 Token 并跳转到登陆页
public remiveTokenToLogin(): void {
public removeTokenToLogin(): void {
this.tokenService.removeToken();
setTimeout(() => {
this.notificationsService.error('久违', '...', { timeOut: 1000 });
Expand All @@ -97,15 +97,15 @@ export class AppComponent implements AfterViewInit, OnInit {
public checkTokenValidity(): void {
this.httpService
.post(API_PATH.CHECK_TOKEN)
.then(_ => {
.then(() => {
// 通过验证,则初始化 APP
console.info('远程 Token 验证成功,正常工作');
this.initAppOptions();
this.renewalService.autoRun();
})
.catch(error => {
console.warn('Token 被验证是无效的,跳登陆页', error);
this.remiveTokenToLogin();
this.removeTokenToLogin();
});
}

Expand All @@ -119,6 +119,6 @@ export class AppComponent implements AfterViewInit, OnInit {
// 程序初始化时检查本地 Token
this.tokenService.isTokenValid()
? this.checkTokenValidity()
: this.remiveTokenToLogin();
: this.removeTokenToLogin();
}
}
2 changes: 1 addition & 1 deletion src/app/app.routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ export const routes: Routes = [
{ path: '**', redirectTo: 'dashboard' }
];

export const RoutingModule = RouterModule.forRoot(routes, { useHash: false });
export const RoutingModule = RouterModule.forRoot(routes, { useHash: false, relativeLinkResolution: 'legacy' });
Loading

0 comments on commit 5f36284

Please sign in to comment.