vue2-client 1.11.4 → 1.11.6-alpha

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/.babelrc +3 -0
  2. package/babel.config.js +18 -21
  3. package/jest.config.js +22 -21
  4. package/package.json +5 -4
  5. package/src/base-client/components/common/CitySelect/CitySelect.vue +366 -342
  6. package/src/base-client/components/common/Upload/Upload.vue +322 -322
  7. package/src/base-client/components/common/XDescriptions/XDescriptionsGroup.vue +314 -304
  8. package/src/base-client/components/common/XDescriptions/demo.vue +51 -50
  9. package/src/base-client/components/common/XFormGroup/demo.vue +39 -46
  10. package/src/base-client/components/common/XFormTable/demo.vue +60 -60
  11. package/src/components/STable/index.js +426 -426
  12. package/src/expression/ExpressionRunner.js +26 -0
  13. package/src/expression/TestExpression.js +508 -0
  14. package/src/expression/core/Delegate.js +113 -0
  15. package/src/expression/core/Expression.js +1323 -0
  16. package/src/expression/core/Program.js +933 -0
  17. package/src/expression/core/Token.js +27 -0
  18. package/src/expression/enums/ExpressionType.js +81 -0
  19. package/src/expression/enums/TokenType.js +11 -0
  20. package/src/expression/exception/BreakWayException.js +2 -0
  21. package/src/expression/exception/ContinueWayException.js +2 -0
  22. package/src/expression/exception/ExpressionException.js +28 -0
  23. package/src/expression/exception/ReturnWayException.js +14 -0
  24. package/src/expression/exception/ServiceException.js +22 -0
  25. package/src/expression/instances/JSONArray.js +48 -0
  26. package/src/expression/instances/JSONObject.js +122 -0
  27. package/src/expression/instances/LogicConsole.js +45 -0
  28. package/src/expression/ts/ExpressionRunner.ts +28 -0
  29. package/src/expression/ts/TestExpression.ts +509 -0
  30. package/src/expression/ts/core/Delegate.ts +114 -0
  31. package/src/expression/ts/core/Expression.ts +1309 -0
  32. package/src/expression/ts/core/Program.ts +950 -0
  33. package/src/expression/ts/core/Token.ts +29 -0
  34. package/src/expression/ts/enums/ExpressionType.ts +81 -0
  35. package/src/expression/ts/enums/TokenType.ts +13 -0
  36. package/src/expression/ts/exception/BreakWayException.ts +2 -0
  37. package/src/expression/ts/exception/ContinueWayException.ts +2 -0
  38. package/src/expression/ts/exception/ExpressionException.ts +28 -0
  39. package/src/expression/ts/exception/ReturnWayException.ts +14 -0
  40. package/src/expression/ts/exception/ServiceException.ts +22 -0
  41. package/src/expression/ts/instances/JSONArray.ts +48 -0
  42. package/src/expression/ts/instances/JSONObject.ts +109 -0
  43. package/src/expression/ts/instances/LogicConsole.ts +32 -0
  44. package/src/logic/LogicRunner.js +67 -0
  45. package/src/logic/TestLogic.js +13 -0
  46. package/src/logic/plugins/common/DateTools.js +32 -0
  47. package/src/logic/plugins/index.js +5 -0
  48. package/src/logic/ts/LogicRunner.ts +67 -0
  49. package/src/logic/ts/TestLogic.ts +13 -0
  50. package/src/pages/LogicCallExample/index.vue +30 -0
  51. package/src/router/async/router.map.js +4 -2
  52. package/src/services/user.js +2 -0
  53. package/src/store/mutation-types.js +1 -0
  54. package/src/utils/EncryptUtil.js +23 -0
  55. package/src/utils/indexedDB.js +234 -234
  56. package/src/utils/request.js +382 -362
  57. package/test/request.test.js +17 -0
@@ -0,0 +1,29 @@
1
+ import TokenType from '../enums/TokenType'
2
+
3
+ export default class Token {
4
+ private type: TokenType;
5
+ private value: any;
6
+ private startPos: number;
7
+
8
+ constructor(type: TokenType, value: any, startPos: number) {
9
+ this.type = type;
10
+ this.value = value;
11
+ this.startPos = startPos;
12
+ }
13
+
14
+ public toString() : string {
15
+ return this.type.toString() + this.value;
16
+ }
17
+
18
+ public getType() : TokenType {
19
+ return this.type;
20
+ }
21
+
22
+ public getValue() : any {
23
+ return this.value;
24
+ }
25
+
26
+ public getStartPos() : number {
27
+ return this.startPos;
28
+ }
29
+ }
@@ -0,0 +1,81 @@
1
+ enum ExpressionType {
2
+ // >
3
+ GreaterThan,
4
+ // >=
5
+ GreaterThanOrEqual,
6
+ // <
7
+ LessThan,
8
+ // <=
9
+ LessThanOrEqual,
10
+ //= =
11
+ Equal,
12
+ //! =
13
+ NotEqual,
14
+ // +
15
+ Add,
16
+ // -
17
+ Subtract,
18
+ //*
19
+ Multiply,
20
+ // 除法
21
+ Divide,
22
+ // 求余
23
+ Modulo,
24
+
25
+ // 字符串连接
26
+ Concat,
27
+ // 逻辑非
28
+ Not,
29
+ // 逻辑与
30
+ And,
31
+ // 逻辑或
32
+ Or,
33
+
34
+ // 常数
35
+ Constant,
36
+ // 标识符
37
+ Identity,
38
+
39
+ // 获取对象属性
40
+ Property,
41
+
42
+ // 产生Json对象
43
+ Json,
44
+ // 产生Json数组
45
+ Array,
46
+ // Json对象属性值对
47
+ Attr,
48
+ // 数组下标,[0]
49
+ ArrayIndex,
50
+ // 函数调用
51
+ Call,
52
+ // for循环
53
+ For,
54
+ // 逗号表达式
55
+ Comma,
56
+ // 赋值语句
57
+ Assign,
58
+ // 条件语句
59
+ Condition,
60
+ // 参数
61
+ Param,
62
+ // Try
63
+ Try,
64
+ // Catch
65
+ Catch,
66
+ // 跳出
67
+ Return,
68
+ // 抛出异常
69
+ Throw,
70
+ // 校验
71
+ Validate,
72
+ // 断言
73
+ Assert,
74
+ // 循环终止
75
+ Break,
76
+ // 循环跳过
77
+ Continue,
78
+ // lambda
79
+ Lambda
80
+ }
81
+ export default ExpressionType
@@ -0,0 +1,13 @@
1
+ import ExpressionType from "@/expression/enums/ExpressionType";
2
+
3
+ enum TokenType {
4
+ Int = 'Int',
5
+ Double = 'Double',
6
+ Bool = 'Bool',
7
+ String = 'String',
8
+ Identy = 'Identity',
9
+ Oper = 'Oper',
10
+ End = 'End',
11
+ Null = 'Null'
12
+ }
13
+ export default TokenType
@@ -0,0 +1,2 @@
1
+ export default class BreakWayException extends Error {
2
+ }
@@ -0,0 +1,2 @@
1
+ export default class ContinueWayException extends Error {
2
+ }
@@ -0,0 +1,28 @@
1
+ /**
2
+ * 表达式执行异常,将显示执行异常的位置信息
3
+ */
4
+ export default class ExpressionException extends Error {
5
+ constructor(source: string, pos: number, cause: Error) {
6
+ let message: string;
7
+ let beforeErrorContent: string = source.substring(0, pos).trim();
8
+ const length: number = beforeErrorContent.length;
9
+ if (length > 1000) {
10
+ beforeErrorContent = "以上省略......\n" + beforeErrorContent.substring(length - 1000);
11
+ }
12
+ const afterErrorContent: string = source.substring(pos);
13
+ const afterErrorContentIndex: number = afterErrorContent.indexOf("\n");
14
+ if (afterErrorContentIndex == -1) {
15
+ message = beforeErrorContent.trim() + " <- " + afterErrorContent;
16
+ } else {
17
+ message = beforeErrorContent.trim() + " <- " + afterErrorContent.substring(0, afterErrorContentIndex) + "\n后续省略......";
18
+ }
19
+
20
+ // 通过原生 Error 的 cause 参数传递原因
21
+ super(message, { cause });
22
+ this.name = this.constructor.name;
23
+
24
+ if (Error.captureStackTrace) {
25
+ Error.captureStackTrace(this, this.constructor);
26
+ }
27
+ }
28
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Return 方法
3
+ */
4
+ export default class ReturnWayException extends Error {
5
+ private readonly returnObject : any
6
+ constructor(returnValue: any) {
7
+ super();
8
+ this.returnObject = returnValue;
9
+ }
10
+
11
+ public getReturnObject() : any {
12
+ return this.returnObject;
13
+ }
14
+ }
@@ -0,0 +1,22 @@
1
+ export default class ServiceException extends Error {
2
+ message: string;
3
+ code: number | undefined;
4
+ constructor (message: string, code?: number) {
5
+ super()
6
+ this.message = message;
7
+ this.code = code;
8
+ }
9
+
10
+ public getMessage() : string {
11
+ return this.message;
12
+ }
13
+
14
+ public setMessage(message: string) : ServiceException {
15
+ this.message = message;
16
+ return this
17
+ }
18
+
19
+ public getCode() : number | undefined {
20
+ return this.code;
21
+ }
22
+ }
@@ -0,0 +1,48 @@
1
+ import JSONObject from "../instances/JSONObject";
2
+
3
+ export default class JSONArray {
4
+ innerList: Array<any>;
5
+
6
+ constructor(value?: any) {
7
+ if (value && typeof value === "string") {
8
+ this.innerList = JSON.parse(value).map((item: any) => this.wrapValue(item));
9
+ } else if (value && Array.isArray(value)) {
10
+ this.innerList = value.map((item: any) => this.wrapValue(item));
11
+ } else {
12
+ this.innerList = new Array<any>();
13
+ }
14
+ }
15
+
16
+ private wrapValue(value: any): any {
17
+ if (Array.isArray(value)) {
18
+ return new JSONArray(value);
19
+ } else if (value && JSONObject.isPlainObject(value)) {
20
+ return new JSONObject(value);
21
+ }
22
+ return value;
23
+ }
24
+
25
+ public length(): number {
26
+ return this.innerList.length;
27
+ }
28
+
29
+ public put(item: any) {
30
+ this.innerList.push(this.wrapValue(item));
31
+ }
32
+
33
+ public get(index: number): any {
34
+ return this.innerList[index];
35
+ }
36
+
37
+ public toString(): string {
38
+ const replacer = (key: string, value: any): any => {
39
+ if (value instanceof JSONObject) {
40
+ return value.innerMap;
41
+ } else if (value instanceof JSONArray) {
42
+ return value.innerList;
43
+ }
44
+ return value;
45
+ };
46
+ return JSON.stringify(this.innerList, replacer);
47
+ }
48
+ }
@@ -0,0 +1,109 @@
1
+ import JSONArray from "../instances/JSONArray";
2
+
3
+ export default class JSONObject {
4
+ innerMap: { [key: string]: any };
5
+
6
+ constructor(value?: any) {
7
+ let map: { [key: string]: any };
8
+ if (value && typeof value === "string") {
9
+ map = JSON.parse(value);
10
+ } else if (value && typeof value === "object" && !Array.isArray(value)) {
11
+ map = {};
12
+ const keySet = value instanceof JSONObject ? value.keySet() : Object.keys(value);
13
+ for (const key of keySet) {
14
+ const item = value instanceof JSONObject ? value.get(key) : value[key];
15
+ if (Array.isArray(item)) {
16
+ map[key] = new JSONArray(item);
17
+ } else if (JSONObject.isPlainObject(item)) {
18
+ map[key] = new JSONObject(item);
19
+ } else {
20
+ map[key] = item;
21
+ }
22
+ }
23
+ } else {
24
+ map = {};
25
+ }
26
+ this.innerMap = map;
27
+ }
28
+
29
+ public static isPlainObject(value: any): boolean {
30
+ if (!value || typeof value !== "object") return false;
31
+ if (value instanceof JSONObject || value instanceof JSONArray) {
32
+ return false
33
+ }
34
+ const proto = Object.getPrototypeOf(value);
35
+ return proto === Object.prototype || proto === null;
36
+ }
37
+
38
+ public put(key: string, value: any) {
39
+ if (Array.isArray(value)) {
40
+ this.innerMap[key] = new JSONArray(value);
41
+ } else if (JSONObject.isPlainObject(value)) {
42
+ this.innerMap[key] = new JSONObject(value);
43
+ } else {
44
+ this.innerMap[key] = value;
45
+ }
46
+ }
47
+
48
+ public get(key: string): any {
49
+ return this.innerMap[key];
50
+ }
51
+
52
+ public opt(key: string): any {
53
+ return key == null ? null : this.innerMap[key];
54
+ }
55
+
56
+ public optString(key: string, defaultValue: string): string {
57
+ const result = this.opt(key);
58
+ return result ? result : defaultValue;
59
+ }
60
+
61
+ public getBoolean(key: string): boolean {
62
+ const object = this.get(key);
63
+ if (typeof object === "boolean") {
64
+ return object as boolean;
65
+ } else {
66
+ return Boolean(object);
67
+ }
68
+ }
69
+
70
+ public optBoolean(key: string, defaultValue: boolean): boolean {
71
+ const val = this.opt(key);
72
+ if (!val) {
73
+ return defaultValue;
74
+ }
75
+ return this.getBoolean(key);
76
+ }
77
+
78
+ public getInt(key: string): number {
79
+ return this.innerMap[key] as number;
80
+ }
81
+
82
+ public getJSONObject(key: string): JSONObject {
83
+ return this.innerMap[key] as JSONObject;
84
+ }
85
+
86
+ public getJSONArray(key: string): JSONArray {
87
+ return this.innerMap[key] as JSONArray;
88
+ }
89
+
90
+ public has(key: string): boolean {
91
+ return this.innerMap.hasOwnProperty(key);
92
+ }
93
+
94
+ public keySet(): string[] {
95
+ return Object.keys(this.innerMap);
96
+ }
97
+
98
+ public toString(): string {
99
+ const replacer = (key: string, value: any): any => {
100
+ if (value instanceof JSONObject) {
101
+ return value.innerMap;
102
+ } else if (value instanceof JSONArray) {
103
+ return value.innerList;
104
+ }
105
+ return value;
106
+ };
107
+ return JSON.stringify(this.innerMap, replacer);
108
+ }
109
+ }
@@ -0,0 +1,32 @@
1
+ // 自定义 Console 类
2
+ export default class LogicConsole {
3
+
4
+ public debug(...args: any[]): void {
5
+ const newArgs = this.convert(args);
6
+ console.debug(...newArgs);
7
+ }
8
+
9
+ public info(...args: any[]): void {
10
+ const newArgs = this.convert(args);
11
+ console.info(...newArgs);
12
+ }
13
+
14
+ public warn(...args: any[]): void {
15
+ const newArgs = this.convert(args);
16
+ console.warn(...newArgs);
17
+ }
18
+
19
+ public error(...args: any[]): void {
20
+ const newArgs = this.convert(args);
21
+ console.error(...newArgs);
22
+ }
23
+
24
+ private convert(args: any[]): any[] {
25
+ return args.map(arg => {
26
+ if (typeof arg === 'object' && arg !== null && typeof arg.toString === 'function') {
27
+ return arg.toString();
28
+ }
29
+ return arg;
30
+ })
31
+ }
32
+ }
@@ -0,0 +1,67 @@
1
+ import JSONObject from '../expression/instances/JSONObject'
2
+ import ServiceException from '../expression/exception/ServiceException'
3
+ import LogicConsole from '../expression/instances/LogicConsole'
4
+ import ExpressionRunner from '../expression/ExpressionRunner'
5
+ import { getConfigByNameAsync } from '@vue2-client/services/api/common'
6
+ import * as Plugins from './plugins/index'
7
+
8
+ export default class LogicRunner {
9
+ static logicConsoleInstance = new LogicConsole()
10
+
11
+ /**
12
+ * 是否存在指定名称的Logic资源
13
+ *
14
+ * @param logicName Logic名称
15
+ * @return 是否存在
16
+ */
17
+ static async has (logicName) {
18
+ return await LogicRunner.getLogic(logicName, false, (result) => {
19
+ return result != null
20
+ })
21
+ }
22
+
23
+ /**
24
+ * 执行Logic
25
+ *
26
+ * @param logicName Logic名称
27
+ * @param param 参数
28
+ * @return 执行结果
29
+ */
30
+ static async run (logicName, param) {
31
+ // 获取Logic资源
32
+ const result = await LogicRunner.getLogic(logicName, false)
33
+ if (!result || !result.source) {
34
+ throw new ServiceException('Logic资源' + logicName + '未找到', 400)
35
+ }
36
+ let paramStr
37
+ if (param instanceof JSONObject) {
38
+ paramStr = param.toString()
39
+ } else {
40
+ paramStr = JSON.stringify(param)
41
+ }
42
+ LogicRunner.logicConsoleInstance.info(`执行Logic[${logicName}],params: ${paramStr}`)
43
+ // 附加用户注册的对象到业务逻辑中
44
+ const plugins = new JSONObject()
45
+ plugins.put('data', param)
46
+ plugins.put('log', LogicRunner.logicConsoleInstance)
47
+ plugins.put('ENV', result.$globalProp)
48
+ plugins.put('logic', this)
49
+ plugins.putAll(Plugins.default)
50
+ return LogicRunner.runExpression(result.source, plugins)
51
+ }
52
+
53
+ /**
54
+ * 执行原生表达式
55
+ *
56
+ * @param source 表达式内容
57
+ * @param params 参数
58
+ * @return 执行结果
59
+ */
60
+ static async runExpression (source, params) {
61
+ return await ExpressionRunner.run(source, params)
62
+ }
63
+
64
+ static async getLogic (logicName, isDev) {
65
+ return await getConfigByNameAsync(logicName, undefined, isDev)
66
+ }
67
+ }
@@ -0,0 +1,13 @@
1
+ import LogicRunner from './LogicRunner'
2
+
3
+ testLogicCall()
4
+
5
+ /**
6
+ * testLogicCall
7
+ */
8
+ function testLogicCall () {
9
+ const result = LogicRunner.run('testVueLogic', {
10
+ test: '1'
11
+ })
12
+ console.info(result)
13
+ }
@@ -0,0 +1,32 @@
1
+ export default class DateTools {
2
+ static instance = new DateTools()
3
+
4
+ constructor () {
5
+ if (DateTools.instance) {
6
+ return DateTools.instance
7
+ }
8
+ DateTools.instance = this
9
+ }
10
+
11
+ static getInstance () {
12
+ if (!DateTools.instance) {
13
+ DateTools.instance = new DateTools()
14
+ }
15
+ return DateTools.instance
16
+ }
17
+
18
+ /**
19
+ * 获取当前时间
20
+ * @returns {string} yyyy-MM-dd HH:mm:ss
21
+ */
22
+ getNow2 () {
23
+ const now = new Date()
24
+ const year = now.getFullYear()
25
+ const month = String(now.getMonth() + 1).padStart(2, '0') // 月份从 0 开始,所以要 +1
26
+ const day = String(now.getDate()).padStart(2, '0')
27
+ const hours = String(now.getHours()).padStart(2, '0')
28
+ const minutes = String(now.getMinutes()).padStart(2, '0')
29
+ const seconds = String(now.getSeconds()).padStart(2, '0')
30
+ return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
31
+ }
32
+ }
@@ -0,0 +1,5 @@
1
+ import DateTools from '@vue2-client/logic/plugins/common/DateTools'
2
+
3
+ export default {
4
+ dateTools: DateTools.getInstance()
5
+ }
@@ -0,0 +1,67 @@
1
+ import JSONObject from "../../expression/instances/JSONObject";
2
+ import ServiceException from "../../expression/exception/ServiceException";
3
+ import LogicConsole from "../../expression/instances/LogicConsole";
4
+ import ExpressionRunner from "../../expression/ExpressionRunner";
5
+ import { indexedDB } from '../../utils/indexedDB'
6
+
7
+ export default class LogicRunner {
8
+
9
+ private static logicConsoleInstance: LogicConsole = new LogicConsole();
10
+
11
+ /**
12
+ * 是否存在指定名称的Logic资源
13
+ *
14
+ * @param logicName Logic名称
15
+ * @return 是否存在
16
+ */
17
+ public static has(logicName: string): boolean {
18
+ return LogicRunner.getLogic(logicName, false, (result: any) => {
19
+ return result != null;
20
+ });
21
+ }
22
+
23
+ /**
24
+ * 执行Logic
25
+ *
26
+ * @param logicName Logic名称
27
+ * @param param 参数
28
+ * @return 执行结果
29
+ */
30
+ public static run(logicName: string, param: JSONObject | Object) : any {
31
+ // 获取Logic资源
32
+ const source = LogicRunner.getLogic(logicName, false, (result: any) => {
33
+ return result;
34
+ });
35
+ if (source == null) {
36
+ throw new ServiceException("Logic资源" + logicName + "未找到", 400)
37
+ }
38
+ LogicRunner.logicConsoleInstance.info("执行Logic[{}],params: {}", logicName, param)
39
+ // 附加用户注册的对象到业务逻辑中
40
+ const plugins = new JSONObject();
41
+ plugins.put("data", param);
42
+ plugins.put("log", LogicRunner.logicConsoleInstance);
43
+ plugins.put("logic", LogicRunner.prototype);
44
+ return LogicRunner.runExpression(source, plugins);
45
+ }
46
+
47
+ /**
48
+ * 执行原生表达式
49
+ *
50
+ * @param source 表达式内容
51
+ * @param params 参数
52
+ * @return 执行结果
53
+ */
54
+ private static runExpression(source: string, params: JSONObject) : any {
55
+ return ExpressionRunner.run(source, params)
56
+ }
57
+
58
+ private static getLogic(logicName: string, isDev: boolean, callback: Function) : any {
59
+ let apiPre = '/api/'
60
+ if (isDev) {
61
+ apiPre = '/devApi/'
62
+ }
63
+ const serviceName = process.env.VUE_APP_SYSTEM_NAME
64
+ const getConfigUrl = apiPre + serviceName + '/logic/openapi/getLiuliConfiguration'
65
+ indexedDB.getByWeb(logicName, getConfigUrl, {configName: logicName}, callback)
66
+ }
67
+ }
@@ -0,0 +1,13 @@
1
+ import LogicRunner from './LogicRunner'
2
+
3
+ testLogicCall()
4
+
5
+ /**
6
+ * testLogicCall
7
+ */
8
+ function testLogicCall () {
9
+ const result = LogicRunner.run('testVueLogic', {
10
+ test: '1'
11
+ })
12
+ console.info(result)
13
+ }
@@ -0,0 +1,30 @@
1
+ <script setup>
2
+
3
+ import LogicRunner from '@vue2-client/logic/LogicRunner'
4
+ import { ref } from 'vue'
5
+
6
+ const metaData = ref({
7
+ inputValue: '',
8
+ displayValue: 'default'
9
+ })
10
+
11
+ async function testLogic () {
12
+ const result = await LogicRunner.run('testVueLogic', {
13
+ metaData: metaData
14
+ })
15
+ console.info('pageTest:' + result)
16
+ }
17
+ </script>
18
+
19
+ <template>
20
+ <div>
21
+ 录入值:<a-input v-model="metaData.inputValue" />
22
+ 显示值:<span ref="displaySpan">{{ metaData.displayValue }}</span>
23
+ <br/>
24
+ <a-button @click="testLogic">修改</a-button>
25
+ </div>
26
+ </template>
27
+
28
+ <style scoped lang="less">
29
+
30
+ </style>
@@ -52,10 +52,11 @@ routerResource.newDynamicStatistics = () => import('@vue2-client/pages/NewDynami
52
52
  routerResource.example = {
53
53
  path: 'example',
54
54
  name: '示例主页面',
55
+ // component: () => import('@vue2-client/base-client/components/common/XDescriptions/demo.vue'),
55
56
  // component: () => import('@vue2-client/base-client/components/common/XAddNativeForm/demo.vue'),
56
- // component: () => import('@vue2-client/base-client/components/common/XFormGroup/demo.vue'),
57
+ component: () => import('@vue2-client/base-client/components/common/XFormGroup/demo.vue'),
57
58
  // component: () => import('@vue2-client/base-client/components/common/XReport/XReportDemo.vue'),
58
- component: () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue'),
59
+ // component: () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue'),
59
60
  // component: () => import('@vue2-client/base-client/components/common/XDatePicker/demo.vue'),
60
61
  // component: () => import('@vue2-client/base-client/components/common/XTab/XTabDemo.vue'),
61
62
  // component: () => import('@vue2-client/base-client/components/common/XReportGrid/XReportDemo.vue'),
@@ -67,6 +68,7 @@ routerResource.example = {
67
68
  // component: () => import('@vue2-client/base-client/components/common/XPrint/Demo.vue'),
68
69
  // component: () => import('@vue2-client/base-client/components/AI/demo.vue'),
69
70
  // component: () => import('@vue2-client/components/g2Charts/demo.vue'),
71
+ // component: () => import('@vue2-client/pages/LogicCallExample/index.vue'),
70
72
  }
71
73
  // routerResource.example = () =>
72
74
  // import('@vue2-client/pages/Example')
@@ -9,6 +9,7 @@ import {
9
9
  import { request, METHOD, removeAuthorization } from '@vue2-client/utils/request'
10
10
  import EncryptUtil from '@vue2-client/utils/EncryptUtil'
11
11
  import axios from 'axios'
12
+ import { V4_SESSION_KEY } from '@/store/mutation-types'
12
13
 
13
14
  /**
14
15
  * 登录服务
@@ -78,6 +79,7 @@ export function logout () {
78
79
  localStorage.removeItem(process.env.VUE_APP_ROUTES_KEY)
79
80
  localStorage.removeItem(process.env.VUE_APP_PERMISSIONS_KEY)
80
81
  localStorage.removeItem(process.env.VUE_APP_ROLES_KEY)
82
+ localStorage.removeItem(V4_SESSION_KEY)
81
83
  removeAuthorization()
82
84
  })
83
85
  })
@@ -1,3 +1,4 @@
1
1
  export const ACCESS_TOKEN = 'Access-Token'
2
2
  export const V4_ACCESS_TOKEN = 'Authorization'
3
3
  export const SYSTEM_VERSION = 'systemVersion'
4
+ export const V4_SESSION_KEY = 'v4-session-key'