feat/task1-c-wallet
parent
8d1f68a61c
commit
306eb704b9
|
|
@ -112,7 +112,7 @@ class User extends Common
|
||||||
*/
|
*/
|
||||||
public function WechatUserAuth()
|
public function WechatUserAuth()
|
||||||
{
|
{
|
||||||
$result = (new \base\Wechat('111', '222'))->GetAuthSessionKey(input('authcode'));
|
$result = (new \base\Wechat('wxdaafcb5682165b02', 'e6e46d2f4b04078771a2cd78c95d400b'))->GetAuthSessionKey(input('authcode'));
|
||||||
if($result !== false)
|
if($result !== false)
|
||||||
{
|
{
|
||||||
return DataReturn('授权登录成功', 0, $result);
|
return DataReturn('授权登录成功', 0, $result);
|
||||||
|
|
@ -130,7 +130,7 @@ class User extends Common
|
||||||
*/
|
*/
|
||||||
public function WechatUserInfo()
|
public function WechatUserInfo()
|
||||||
{
|
{
|
||||||
$result = (new \base\Wechat('100', '200'))->DecryptData(R('encrypted_data'), input('iv'), input('openid'));
|
$result = (new \base\Wechat('wxdaafcb5682165b02', 'e6e46d2f4b04078771a2cd78c95d400b'))->DecryptData(R('encrypted_data'), input('iv'), input('openid'));
|
||||||
|
|
||||||
if(is_array($result))
|
if(is_array($result))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -309,7 +309,7 @@ App({
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
header: { 'content-type': 'application/x-www-form-urlencoded' },
|
header: { 'content-type': 'application/x-www-form-urlencoded' },
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
if (res.data.state == 'ok') {
|
if (res.data.code == 0) {
|
||||||
wx.setStorage({
|
wx.setStorage({
|
||||||
key: $this.data.cache_user_login_key,
|
key: $this.data.cache_user_login_key,
|
||||||
data: res.data.data
|
data: res.data.data
|
||||||
|
|
@ -354,7 +354,7 @@ App({
|
||||||
header: { 'content-type': 'application/x-www-form-urlencoded' },
|
header: { 'content-type': 'application/x-www-form-urlencoded' },
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
wx.hideLoading();
|
wx.hideLoading();
|
||||||
if (res.data.state == 'ok') {
|
if (res.data.code == 0) {
|
||||||
wx.setStorage({
|
wx.setStorage({
|
||||||
key: $this.data.cache_user_info_key,
|
key: $this.data.cache_user_info_key,
|
||||||
data: res.data.data
|
data: res.data.data
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue