system-clients 3.0.46 → 3.0.47-fanxian

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 (100) hide show
  1. package/.babelrc +5 -5
  2. package/.editorconfig +9 -9
  3. package/.eslintrc.js +16 -16
  4. package/.gradle/buildOutputCleanup/cache.properties +2 -2
  5. package/README.md +36 -36
  6. package/SystemClient.iml +11 -11
  7. package/build/css-loaders.js +34 -34
  8. package/build/dev-client.js +8 -8
  9. package/build/example-server.js +80 -80
  10. package/build/release.sh +28 -28
  11. package/build/utils.js +71 -71
  12. package/build/webpack.base.conf.js +75 -75
  13. package/build/webpack.dev.conf.js +31 -31
  14. package/build/webpack.example.conf.js +49 -49
  15. package/build/webpack.prod.conf.js +60 -60
  16. package/build/webpack.test.conf.js +31 -31
  17. package/build.gradle +6 -6
  18. package/config/dev.env.js +6 -6
  19. package/config/index.js +38 -38
  20. package/config/prod.env.js +3 -3
  21. package/config/test.env.js +6 -6
  22. package/doc/Login.md +7 -7
  23. package/examples/ReadCard/App.vue +23 -23
  24. package/examples/ReadCard/index.html +11 -11
  25. package/examples/ReadCard/main.js +12 -12
  26. package/index.html +21 -21
  27. package/package.json +1 -1
  28. package/release.bat +5 -5
  29. package/src/App.vue +24 -24
  30. package/src/LodopFuncs.js +123 -123
  31. package/src/assets/binding.svg +1 -1
  32. package/src/assets/unbind.svg +1 -1
  33. package/src/assets//345/205/254/345/221/212.svg +1 -1
  34. package/src/assets//347/207/203/346/260/224/347/274/264/350/264/271.eps +116 -116
  35. package/src/assets//350/201/224/347/263/273/346/210/221/344/273/254.svg +1 -1
  36. package/src/components/List.vue +51 -51
  37. package/src/components/Main.vue +632 -533
  38. package/src/components/Table.js +74 -74
  39. package/src/components/Util.js +343 -343
  40. package/src/components/equipment/EquipmentManage.vue +65 -65
  41. package/src/components/equipment/PcAdd.vue +105 -105
  42. package/src/components/equipment/PcList.vue +119 -119
  43. package/src/components/equipment/PcManage.vue +60 -60
  44. package/src/components/equipment/PhoneAdd.vue +94 -94
  45. package/src/components/equipment/PhoneList.vue +102 -102
  46. package/src/components/equipment/PhoneManage.vue +60 -60
  47. package/src/components/equipment/PosAdd.vue +137 -137
  48. package/src/components/equipment/PosList.vue +156 -156
  49. package/src/components/equipment/PosManage.vue +67 -67
  50. package/src/components/materialManage/materialData.vue +44 -44
  51. package/src/components/materialManage/materialList.vue +255 -255
  52. package/src/components/parammanage/AlarmInformation.vue +122 -0
  53. package/src/components/parammanage/ParamManage.vue +42 -42
  54. package/src/components/parammanage/ParamManages.vue +43 -43
  55. package/src/components/parammanage/ParamPage.vue +314 -314
  56. package/src/components/parammanage/ParamPages.vue +214 -222
  57. package/src/components/parammanage/SinglePage.vue +237 -235
  58. package/src/components/parammanage/SinglePages.vue +161 -167
  59. package/src/components/server/AddChangeMsg.vue +66 -66
  60. package/src/components/server/ChangeDeclare.vue +45 -45
  61. package/src/components/server/IconTree.vue +26 -26
  62. package/src/components/server/LeftTree.vue +111 -111
  63. package/src/components/server/LoadData.vue +36 -36
  64. package/src/components/server/Login.vue +625 -624
  65. package/src/components/server/Menu.vue +188 -188
  66. package/src/components/server/ModifyPw.vue +125 -106
  67. package/src/components/server/ResSelect.vue +150 -150
  68. package/src/components/server/ResSelectGroup.vue +140 -140
  69. package/src/components/server/RightTree.vue +263 -263
  70. package/src/components/server/RoleSelector.vue +88 -88
  71. package/src/components/server/TestResSelect.vue +1 -1
  72. package/src/components/server/TestResSelectGroup.vue +388 -388
  73. package/src/components/server/TestRightTree.vue +42 -42
  74. package/src/index.js +7 -7
  75. package/src/plugins/GetLoginInfoService.js +509 -513
  76. package/src/plugins/validation.js +7 -7
  77. package/src/project/ProjectPage.vue +24 -24
  78. package/src/project/State.js +17 -17
  79. package/src/stores/AppData.js +38 -38
  80. package/src/system.js +78 -76
  81. package/src/systemphone.js +11 -11
  82. package/src/util/LdapHelper.js +75 -75
  83. package/static/newStyle/alarm.mp3 +0 -0
  84. package/test/e2e/custom-assertions/elementCount.js +26 -26
  85. package/test/e2e/nightwatch.conf.js +40 -40
  86. package/test/e2e/runner.js +30 -30
  87. package/test/e2e/specs/test.js +14 -14
  88. package/test/unit/.eslintrc +5 -5
  89. package/test/unit/index.js +13 -13
  90. package/test/unit/init.js +10 -10
  91. package/test/unit/specs/base64.spec.js +5 -5
  92. package/test/unit/specs/components/parammanage/SinglePage.spec.js +20 -20
  93. package/test/unit/specs/components/server/LeftTree/App.vue +18 -18
  94. package/test/unit/specs/components/server/LoadData.spec.js +24 -24
  95. package/test/unit/specs/components/server/Login.spec.js +61 -61
  96. package/test/unit/specs/components/server/RightTree.spec.js +50 -50
  97. package/test/unit/specs/plugins/GetLoginInfoService.spec.js +55 -55
  98. package/test/unit/test.html +76 -76
  99. package/.gradle/3.5.1/file-changes/last-build.bin +0 -0
  100. package/.gradle/3.5.1/taskHistory/taskHistory.lock +0 -0
@@ -1,30 +1,30 @@
1
- // 1. start the dev server
2
- var server = require('../../build/dev-server.js')
3
-
4
- // 2. run the nightwatch test suite against it
5
- // to run in additional browsers:
6
- // 1. add an entry in test/e2e/nightwatch.conf.json under "test_settings"
7
- // 2. add it to the --env flag below
8
- // For more information on Nightwatch's config file, see
9
- // http://nightwatchjs.org/guide#settings-file
10
- var spawn = require('cross-spawn')
11
- var runner = spawn(
12
- './node_modules/.bin/nightwatch',
13
- [
14
- '--config', 'test/e2e/nightwatch.conf.js',
15
- '--env', 'chrome'
16
- ],
17
- {
18
- stdio: 'inherit'
19
- }
20
- )
21
-
22
- runner.on('exit', function (code) {
23
- server.close()
24
- process.exit(code)
25
- })
26
-
27
- runner.on('error', function (err) {
28
- server.close()
29
- throw err
30
- })
1
+ // 1. start the dev server
2
+ var server = require('../../build/dev-server.js')
3
+
4
+ // 2. run the nightwatch test suite against it
5
+ // to run in additional browsers:
6
+ // 1. add an entry in test/e2e/nightwatch.conf.json under "test_settings"
7
+ // 2. add it to the --env flag below
8
+ // For more information on Nightwatch's config file, see
9
+ // http://nightwatchjs.org/guide#settings-file
10
+ var spawn = require('cross-spawn')
11
+ var runner = spawn(
12
+ './node_modules/.bin/nightwatch',
13
+ [
14
+ '--config', 'test/e2e/nightwatch.conf.js',
15
+ '--env', 'chrome'
16
+ ],
17
+ {
18
+ stdio: 'inherit'
19
+ }
20
+ )
21
+
22
+ runner.on('exit', function (code) {
23
+ server.close()
24
+ process.exit(code)
25
+ })
26
+
27
+ runner.on('error', function (err) {
28
+ server.close()
29
+ throw err
30
+ })
@@ -1,14 +1,14 @@
1
- // For authoring Nightwatch tests, see
2
- // http://nightwatchjs.org/guide#usage
3
-
4
- module.exports = {
5
- 'partial tests': function (browser) {
6
- browser
7
- .url('http://localhost:8088/Partial.html')
8
- .waitForElementVisible('#app', 500)
9
- .assert.containsText('#app', '默认值')
10
- .url('http://localhost:8088/List.html')
11
- .waitForElementVisible('#app', 5000)
12
- .end()
13
- }
14
- }
1
+ // For authoring Nightwatch tests, see
2
+ // http://nightwatchjs.org/guide#usage
3
+
4
+ module.exports = {
5
+ 'partial tests': function (browser) {
6
+ browser
7
+ .url('http://localhost:8088/Partial.html')
8
+ .waitForElementVisible('#app', 500)
9
+ .assert.containsText('#app', '默认值')
10
+ .url('http://localhost:8088/List.html')
11
+ .waitForElementVisible('#app', 5000)
12
+ .end()
13
+ }
14
+ }
@@ -1,5 +1,5 @@
1
- {
2
- "env": {
3
- "jasmine": true
4
- }
5
- }
1
+ {
2
+ "env": {
3
+ "jasmine": true
4
+ }
5
+ }
@@ -1,13 +1,13 @@
1
- // Polyfill fn.bind() for PhantomJS
2
- /* eslint-disable no-extend-native */
3
- Function.prototype.bind = require('function-bind')
4
-
5
- // require all test files (files that ends with .spec.js)
6
- var testsContext = require.context('./specs', true, /\.spec$/)
7
- testsContext.keys().forEach(testsContext)
8
-
9
- // require all src files except main.js for coverage.
10
- // you can also change this to match only the subset of files that
11
- // you want coverage for.
12
- // var srcContext = require.context('../../src', true, /^\.\/(?!all(\.js)?$)/)
13
- // srcContext.keys().forEach(srcContext)
1
+ // Polyfill fn.bind() for PhantomJS
2
+ /* eslint-disable no-extend-native */
3
+ Function.prototype.bind = require('function-bind')
4
+
5
+ // require all test files (files that ends with .spec.js)
6
+ var testsContext = require.context('./specs', true, /\.spec$/)
7
+ testsContext.keys().forEach(testsContext)
8
+
9
+ // require all src files except main.js for coverage.
10
+ // you can also change this to match only the subset of files that
11
+ // you want coverage for.
12
+ // var srcContext = require.context('../../src', true, /^\.\/(?!all(\.js)?$)/)
13
+ // srcContext.keys().forEach(srcContext)
package/test/unit/init.js CHANGED
@@ -1,10 +1,10 @@
1
- import Vue from 'vue'
2
- import { all } from 'vue-client'
3
- import system from 'src/system'
4
-
5
- export default function () {
6
- Vue.config.silent = false
7
- all()
8
- system()
9
- require('../../src/bootstrap/less/bootstrap.less')
10
- }
1
+ import Vue from 'vue'
2
+ import { all } from 'vue-client'
3
+ import system from 'src/system'
4
+
5
+ export default function () {
6
+ Vue.config.silent = false
7
+ all()
8
+ system()
9
+ require('../../src/bootstrap/less/bootstrap.less')
10
+ }
@@ -1,5 +1,5 @@
1
- describe('base64', () => {
2
- it('加密', () => {
3
- console.log(btoa('1'))
4
- })
5
- })
1
+ describe('base64', () => {
2
+ it('加密', () => {
3
+ console.log(btoa('1'))
4
+ })
5
+ })
@@ -1,20 +1,20 @@
1
- import Vue from 'vue'
2
- import init from 'test/unit/init'
3
- import { TestUtil } from 'vue-client'
4
-
5
- import SinglePage from 'src/components/parammanage/SinglePage'
6
-
7
- describe('SinglePage: 单值管理', () => {
8
- let vm = null
9
- before(async function () {
10
- init()
11
- await Vue.$login.login('cdy', '1')
12
- })
13
-
14
- it('正确显示', async function() {
15
- vm = await TestUtil.createAsyncTest(SinglePage, {
16
- })
17
- })
18
-
19
- })
20
-
1
+ import Vue from 'vue'
2
+ import init from 'test/unit/init'
3
+ import { TestUtil } from 'vue-client'
4
+
5
+ import SinglePage from 'src/components/parammanage/SinglePage'
6
+
7
+ describe('SinglePage: 单值管理', () => {
8
+ let vm = null
9
+ before(async function () {
10
+ init()
11
+ await Vue.$login.login('cdy', '1')
12
+ })
13
+
14
+ it('正确显示', async function() {
15
+ vm = await TestUtil.createAsyncTest(SinglePage, {
16
+ })
17
+ })
18
+
19
+ })
20
+
@@ -1,18 +1,18 @@
1
- <template>
2
- <app-base class="bg">
3
- <div class='flex'>
4
- <article>
5
- <left-tree v-ref:tree></left-tree>
6
- <dynamic :comps='[]' name='main'></dynamic>
7
- </article>
8
- </div>
9
- </app-base>
10
- </template>
11
-
12
- <script>
13
- import LeftTree from 'src/components/server/LeftTree'
14
-
15
- export default {
16
- components: {LeftTree}
17
- }
18
- </script>
1
+ <template>
2
+ <app-base class="bg">
3
+ <div class='flex'>
4
+ <article>
5
+ <left-tree v-ref:tree></left-tree>
6
+ <dynamic :comps='[]' name='main'></dynamic>
7
+ </article>
8
+ </div>
9
+ </app-base>
10
+ </template>
11
+
12
+ <script>
13
+ import LeftTree from 'src/components/server/LeftTree'
14
+
15
+ export default {
16
+ components: {LeftTree}
17
+ }
18
+ </script>
@@ -1,24 +1,24 @@
1
- import init from 'test/unit/init'
2
- import { TestUtil } from 'vue-client'
3
-
4
- import LoadData from 'src/components/server/LoadData'
5
-
6
- describe('LoadData: 加载初始数据', () => {
7
- let vm = null
8
- before((done) => {
9
- init()
10
- vm = TestUtil.createTest(LoadData)
11
- vm.$on('ready', () => {
12
- done()
13
- })
14
- })
15
-
16
- it('正确加载', () => {
17
- assert.equal(vm.$appdata.singleValues.appVer, '15')
18
- assert.isAbove(vm.$appdata.saleParams.price.length, 10)
19
- // assert.lengthOf(vm.$appdata.safeCheckParams, 0)
20
- })
21
- })
22
-
23
- // also see example testing a component with mocks at
24
- // https://github.com/vuejs/vue-loader-example/blob/master/test/unit/a.spec.js#L24-L49
1
+ import init from 'test/unit/init'
2
+ import { TestUtil } from 'vue-client'
3
+
4
+ import LoadData from 'src/components/server/LoadData'
5
+
6
+ describe('LoadData: 加载初始数据', () => {
7
+ let vm = null
8
+ before((done) => {
9
+ init()
10
+ vm = TestUtil.createTest(LoadData)
11
+ vm.$on('ready', () => {
12
+ done()
13
+ })
14
+ })
15
+
16
+ it('正确加载', () => {
17
+ assert.equal(vm.$appdata.singleValues.appVer, '15')
18
+ assert.isAbove(vm.$appdata.saleParams.price.length, 10)
19
+ // assert.lengthOf(vm.$appdata.safeCheckParams, 0)
20
+ })
21
+ })
22
+
23
+ // also see example testing a component with mocks at
24
+ // https://github.com/vuejs/vue-loader-example/blob/master/test/unit/a.spec.js#L24-L49
@@ -1,61 +1,61 @@
1
- import init from 'test/unit/init'
2
- import { TestUtil } from 'vue-client'
3
-
4
- import Login from 'src/components/server/Login'
5
-
6
- describe('测试是否可以正确登录', () => {
7
- let vm = null
8
- before((done) => {
9
- init()
10
- vm = TestUtil.createTest(Login)
11
- vm.$on('ready', () => {
12
- done()
13
- })
14
- })
15
-
16
- it('超管可以正确登录', async function() {
17
- vm.model.ename = '1'
18
- vm.model.password = 'Af@1234'
19
- // 验证码
20
- vm.picLyanzhengma = vm.checkCode
21
- await vm.confirm()
22
- assert.isAbove(vm.$login.jwt.length, 100)
23
- // 检查登录结果
24
- assert.lengthOf(vm.$login.f.functions, 14)
25
- })
26
-
27
- it('正确调用到了通用票据', async function() {
28
- let report = await vm.$resetpost('/rs/report/card_bill', {"data": {"condition":"53"}}, { rejectMsg: null, resolveMsg: null })
29
- assert.include(report.data, '流水号:')
30
- })
31
-
32
- it('海南管理员可以正确登录', async function() {
33
- vm.model.ename = 'hainan'
34
- vm.model.password = '1'
35
- // 验证码
36
- vm.picLyanzhengma = vm.checkCode
37
- await vm.confirm()
38
- assert.isAbove(vm.$login.jwt.length, 1)
39
- // 检查登录结果
40
- assert.isAbove(vm.$login.f.functions.length, 1)
41
- })
42
-
43
- it('正确调用到了自己的票据', async function() {
44
- let report = await vm.$resetpost('/rs/report/card_bill', {"data": {"condition":"53"}}, { rejectMsg: null, resolveMsg: null })
45
- assert.include(report.data, '流水1号:')
46
- })
47
-
48
- it('锆鹏可以正确登录', async function() {
49
- vm.model.ename = 'JcCeShi'
50
- vm.model.password = '1'
51
- // 验证码
52
- vm.picLyanzhengma = vm.checkCode
53
- await vm.confirm()
54
- assert.isAbove(vm.$login.jwt.length, 1)
55
- // 检查登录结果
56
- assert.isAbove(vm.$login.f.functions.length, 1)
57
- })
58
- })
59
-
60
- // also see example testing a component with mocks at
61
- // https://github.com/vuejs/vue-loader-example/blob/master/test/unit/a.spec.js#L24-L49
1
+ import init from 'test/unit/init'
2
+ import { TestUtil } from 'vue-client'
3
+
4
+ import Login from 'src/components/server/Login'
5
+
6
+ describe('测试是否可以正确登录', () => {
7
+ let vm = null
8
+ before((done) => {
9
+ init()
10
+ vm = TestUtil.createTest(Login)
11
+ vm.$on('ready', () => {
12
+ done()
13
+ })
14
+ })
15
+
16
+ it('超管可以正确登录', async function() {
17
+ vm.model.ename = '1'
18
+ vm.model.password = 'Af@1234'
19
+ // 验证码
20
+ vm.picLyanzhengma = vm.checkCode
21
+ await vm.confirm()
22
+ assert.isAbove(vm.$login.jwt.length, 100)
23
+ // 检查登录结果
24
+ assert.lengthOf(vm.$login.f.functions, 14)
25
+ })
26
+
27
+ it('正确调用到了通用票据', async function() {
28
+ let report = await vm.$resetpost('/rs/report/card_bill', {"data": {"condition":"53"}}, { rejectMsg: null, resolveMsg: null })
29
+ assert.include(report.data, '流水号:')
30
+ })
31
+
32
+ it('海南管理员可以正确登录', async function() {
33
+ vm.model.ename = 'hainan'
34
+ vm.model.password = '1'
35
+ // 验证码
36
+ vm.picLyanzhengma = vm.checkCode
37
+ await vm.confirm()
38
+ assert.isAbove(vm.$login.jwt.length, 1)
39
+ // 检查登录结果
40
+ assert.isAbove(vm.$login.f.functions.length, 1)
41
+ })
42
+
43
+ it('正确调用到了自己的票据', async function() {
44
+ let report = await vm.$resetpost('/rs/report/card_bill', {"data": {"condition":"53"}}, { rejectMsg: null, resolveMsg: null })
45
+ assert.include(report.data, '流水1号:')
46
+ })
47
+
48
+ it('锆鹏可以正确登录', async function() {
49
+ vm.model.ename = 'JcCeShi'
50
+ vm.model.password = '1'
51
+ // 验证码
52
+ vm.picLyanzhengma = vm.checkCode
53
+ await vm.confirm()
54
+ assert.isAbove(vm.$login.jwt.length, 1)
55
+ // 检查登录结果
56
+ assert.isAbove(vm.$login.f.functions.length, 1)
57
+ })
58
+ })
59
+
60
+ // also see example testing a component with mocks at
61
+ // https://github.com/vuejs/vue-loader-example/blob/master/test/unit/a.spec.js#L24-L49
@@ -1,50 +1,50 @@
1
- import init from 'test/unit/init'
2
- import { TestUtil } from 'vue-client'
3
- import * as ldapHelper from 'src/util/LdapHelper'
4
-
5
- import RightTree from 'src/components/server/RightTree'
6
-
7
- describe('RightTree: 资源选择树', () => {
8
- let vm = null
9
-
10
- before(() => {
11
- init()
12
- })
13
-
14
- it('正确显示', async function() {
15
- vm = await TestUtil.createAsyncTest(RightTree, {
16
- userid: '20853',
17
- source: 'tool.getFullTree(this.getRights().where(row.getType() == $organization$))'
18
- })
19
- // 中海油不可选择
20
- let ele = document.querySelector('.RightTreeCanNotSelect')
21
- assert.equal(ele.innerText, '中海油', '中海油不能选择')
22
- // 选中根节点
23
- let tree = vm.$children[0].$children[0]
24
- await tree.toggle(tree.toNode[0])
25
- // 海南分公司可以选择
26
- ele = document.querySelector('.RightTreeCanSelect')
27
- assert.equal(ele.innerText, '海南分公司', '海南分公司可以选择')
28
- })
29
-
30
- it('正确选择', (done) => {
31
- let row = vm.model[0].children[0]
32
- vm.$on('re-res', (obj) => {
33
- assert.equal(obj.resids, '1531.1535.')
34
- done()
35
- })
36
- vm.selectclick(row)
37
- })
38
-
39
- it('选中值变化', (done) => {
40
- vm.selectData = '1531.1535.'
41
- vm.selectDataChange()
42
- vm.$nextTick(() => {
43
- assert.equal('海南分公司', vm.textContent)
44
- done()
45
- })
46
- })
47
- })
48
-
49
- // also see example testing a component with mocks at
50
- // https://github.com/vuejs/vue-loader-example/blob/master/test/unit/a.spec.js#L24-L49
1
+ import init from 'test/unit/init'
2
+ import { TestUtil } from 'vue-client'
3
+ import * as ldapHelper from 'src/util/LdapHelper'
4
+
5
+ import RightTree from 'src/components/server/RightTree'
6
+
7
+ describe('RightTree: 资源选择树', () => {
8
+ let vm = null
9
+
10
+ before(() => {
11
+ init()
12
+ })
13
+
14
+ it('正确显示', async function() {
15
+ vm = await TestUtil.createAsyncTest(RightTree, {
16
+ userid: '20853',
17
+ source: 'tool.getFullTree(this.getRights().where(row.getType() == $organization$))'
18
+ })
19
+ // 中海油不可选择
20
+ let ele = document.querySelector('.RightTreeCanNotSelect')
21
+ assert.equal(ele.innerText, '中海油', '中海油不能选择')
22
+ // 选中根节点
23
+ let tree = vm.$children[0].$children[0]
24
+ await tree.toggle(tree.toNode[0])
25
+ // 海南分公司可以选择
26
+ ele = document.querySelector('.RightTreeCanSelect')
27
+ assert.equal(ele.innerText, '海南分公司', '海南分公司可以选择')
28
+ })
29
+
30
+ it('正确选择', (done) => {
31
+ let row = vm.model[0].children[0]
32
+ vm.$on('re-res', (obj) => {
33
+ assert.equal(obj.resids, '1531.1535.')
34
+ done()
35
+ })
36
+ vm.selectclick(row)
37
+ })
38
+
39
+ it('选中值变化', (done) => {
40
+ vm.selectData = '1531.1535.'
41
+ vm.selectDataChange()
42
+ vm.$nextTick(() => {
43
+ assert.equal('海南分公司', vm.textContent)
44
+ done()
45
+ })
46
+ })
47
+ })
48
+
49
+ // also see example testing a component with mocks at
50
+ // https://github.com/vuejs/vue-loader-example/blob/master/test/unit/a.spec.js#L24-L49
@@ -1,55 +1,55 @@
1
- import init from 'test/unit/init'
2
-
3
- import Vue from 'vue'
4
-
5
- describe('GetLoginInfoService: 登录服务', () => {
6
- before(() => {
7
- init()
8
- })
9
-
10
- it('取登录数据', async function () {
11
- let data = {name: 'hainan', password: '1'}
12
- let result = await Vue.resetpost('rs/logic/getLogin', data)
13
- assert.equal('登录成功', result.states);
14
- })
15
-
16
- it('取登录数据', async function () {
17
- let data = `{name: 'hainan', password: '1'}`
18
- data = btoa(data)
19
- let result = await Vue.resetpost('rs/logic/getLogin', '$' + data)
20
- assert.equal('登录成功', result.data.states);
21
- })
22
-
23
- it('超管登录', async function() {
24
- Vue.$login.afterLogin.push((f) => {
25
- return new Promise((resolve, reject) => {
26
- setTimeout(() => {
27
- console.log('注册成功')
28
- resolve()
29
- }, 100)
30
- })
31
- })
32
- await Vue.$login.login('hainan', '1')
33
- console.log('登录完成')
34
- assert.equal(document.cookie, 'loginId=20853')
35
- // 检查登录结果
36
- console.log(JSON.stringify(Vue.$login.r))
37
- assert.lengthOf(Vue.$login.f.functions, 15)
38
- await new Promise((resolve, reject) => {
39
- setTimeout(()=>{
40
- resolve()
41
- }, 200)
42
- })
43
- })
44
-
45
- it('中海油登录', () => {
46
- return Vue.$login.login('hns', '1').then(() => {
47
- assert.equal(document.cookie, 'loginId=20853')
48
- // 检查登录结果
49
- assert.lengthOf(Vue.$login.f.functions, 13)
50
- })
51
- })
52
- })
53
-
54
- // also see example testing a component with mocks at
55
- // https://github.com/vuejs/vue-loader-example/blob/master/test/unit/a.spec.js#L24-L49
1
+ import init from 'test/unit/init'
2
+
3
+ import Vue from 'vue'
4
+
5
+ describe('GetLoginInfoService: 登录服务', () => {
6
+ before(() => {
7
+ init()
8
+ })
9
+
10
+ it('取登录数据', async function () {
11
+ let data = {name: 'hainan', password: '1'}
12
+ let result = await Vue.resetpost('rs/logic/getLogin', data)
13
+ assert.equal('登录成功', result.states);
14
+ })
15
+
16
+ it('取登录数据', async function () {
17
+ let data = `{name: 'hainan', password: '1'}`
18
+ data = btoa(data)
19
+ let result = await Vue.resetpost('rs/logic/getLogin', '$' + data)
20
+ assert.equal('登录成功', result.data.states);
21
+ })
22
+
23
+ it('超管登录', async function() {
24
+ Vue.$login.afterLogin.push((f) => {
25
+ return new Promise((resolve, reject) => {
26
+ setTimeout(() => {
27
+ console.log('注册成功')
28
+ resolve()
29
+ }, 100)
30
+ })
31
+ })
32
+ await Vue.$login.login('hainan', '1')
33
+ console.log('登录完成')
34
+ assert.equal(document.cookie, 'loginId=20853')
35
+ // 检查登录结果
36
+ console.log(JSON.stringify(Vue.$login.r))
37
+ assert.lengthOf(Vue.$login.f.functions, 15)
38
+ await new Promise((resolve, reject) => {
39
+ setTimeout(()=>{
40
+ resolve()
41
+ }, 200)
42
+ })
43
+ })
44
+
45
+ it('中海油登录', () => {
46
+ return Vue.$login.login('hns', '1').then(() => {
47
+ assert.equal(document.cookie, 'loginId=20853')
48
+ // 检查登录结果
49
+ assert.lengthOf(Vue.$login.f.functions, 13)
50
+ })
51
+ })
52
+ })
53
+
54
+ // also see example testing a component with mocks at
55
+ // https://github.com/vuejs/vue-loader-example/blob/master/test/unit/a.spec.js#L24-L49