1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- let app = getApp()
- let domain = "https://rismanage3.pacsonline.cn";
- let url = domain + '/api/train/getUserDetail';
- Page({
- data: {
- authCode: "",
- corpId: ''
- },
- onLoad() {
- // let that = this;
- let time = null
- this.setData({
- corpId: app.globaldata.corpId
- })
-
- // dd.showLoading();
- dd.getAuthCode({
- success: (res) => {
- this.setData({
- authCode: res.authCode
- })
- //dd.alert({content: "step1"});
- dd.httpRequest({
- url: url,
- method: 'POST',
- data: {
- code: res.authCode
- },
- dataType: 'json',
- success: (res) => {
- // dd.alert({content: "step2"});
- console.log('success----', res)
- dd.setStorage({
- key: 'userInf',
- data: {
- phone: res.data.data.mobile,
- name: res.data.data.name,
- avatar: res.data.data.avatar
- }
- });
- time = setInterval(function () {
- dd.reLaunch({
- url: "/pages/index/index"
- })
- clearInterval(time);
- }, 1000)
-
- },
- fail: (res) => {
- console.log("httpRequestFail---", res)
- dd.alert({ content: JSON.stringify(res) });
- },
- complete: (res) => {
- // dd.hideLoading();
- }
- });
- },
- fail: (err) => {
- // dd.alert({content: "step3"});
- dd.alert({
- content: JSON.stringify(err)
- })
- }
- })
- }
- });
|