lwqzx_auth 0.1.7 → 0.1.8

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fb1a10fbd6c774433b37b339e044940d59f8642df927bc80cf51f55b3d113df1
4
- data.tar.gz: 870313cc1052177ae59d0b5a25694683f4aa98ac401183283ff69b1c9f25146f
3
+ metadata.gz: 4d4b00982373eba2a84a4e76fa0e5ba32e4d9d608d2e9c5300ab16b3ee3a6561
4
+ data.tar.gz: ef0ce7b8438bcfc94c2793a1782c969a659488afda9ff7314483ba8643ca8af4
5
5
  SHA512:
6
- metadata.gz: 92d33d2c7ec0d2b5dd5857d2c3bcdfaa563e0908cb5c2fea5f61f70e9ee4bca4d1400d259c7c0dfddf98100ad933a326980630fc3076d0d973403b47385f17a4
7
- data.tar.gz: 85ec89c5bf4630e18aff12256700913c6bf1964cf77cfab4b73259d654cc078a6802fa386bbaa10ee8a998eef697e04cd0b913e131fc282531349dd02a99d2f9
6
+ metadata.gz: 1bd0a40a3259435762dad096e1a712bfe95dc26c0ccc442ed0d3895bbe4669769befc1e22569cb29ef5fcb167780b996748009e57874b29b74a9a4ec5ad70e78
7
+ data.tar.gz: ffd61567689bcb3f120917a4f0f6876bba4c61fef787dbeab6901b91ba681689970db9787a2c3196168d4859f79a9d5c95de3ca5dd6091790042511eac309f52
@@ -21,9 +21,10 @@ module LwqzxAuth
21
21
  login = params[:login]
22
22
  psd = params[:password]
23
23
  hsh = lauth(login,psd)
24
- if hsh["login"].blank?
24
+ if hsh["name"].blank?
25
25
  redirect_to login_path , alert: "用户信息有误"
26
26
  else
27
+ login = hsh["login"]
27
28
  name = hsh["name"]
28
29
  groups = hsh["user_group"]
29
30
  session[:login] = login
@@ -37,8 +38,7 @@ module LwqzxAuth
37
38
  def lauth(login,passwd)
38
39
  lurl = "http://www.lwqzx.sdedu.net/kernel/net_school/core/jslogin.php"
39
40
  res = ::RestClient.post lurl,{login: login, password: passwd}
40
- content=res.body
41
- return content
41
+ return JSON.parse(res.body)
42
42
  end
43
43
 
44
44
  end
@@ -1,3 +1,3 @@
1
1
  module LwqzxAuth
2
- VERSION = '0.1.7'
2
+ VERSION = '0.1.8'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lwqzx_auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - zxy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-09 00:00:00.000000000 Z
11
+ date: 2019-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client