gc_mobile 1.0.12 → 1.1.0
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.
- package/example/dd/App.vue +57 -51
- package/example/dd/pages/index/index.vue +67 -46
- package/libs/main.js +5699 -1071
- package/libs/main.umd.cjs +327 -8
- package/package.json +3 -1
- package/src/assets/html/bind.xml +306 -0
- package/src/index.js +8 -0
- package/src/lib/utils.js +0 -1
- package/src/modules/dd.js +140 -1
- package/vite.config.js +8 -8
- package/example/.DS_Store +0 -0
package/example/dd/App.vue
CHANGED
|
@@ -1,57 +1,63 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import mobile,{utils} from "../../libs/main";
|
|
1
|
+
<script>
|
|
2
|
+
import mobile, { utils } from "../../libs/main";
|
|
3
3
|
import signature from "gc_rsa/src/lib/signature";
|
|
4
4
|
|
|
5
5
|
import Request from "luch-request";
|
|
6
6
|
const http = new Request();
|
|
7
|
-
http.interceptors.request.use(config=>{
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
//
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export default {
|
|
7
|
+
http.interceptors.request.use((config) => {
|
|
8
|
+
console.log("config", config);
|
|
9
|
+
if (config.url.indexOf("/apiList") > -1) {
|
|
10
|
+
// originQuery: config.params,
|
|
11
|
+
// });
|
|
12
|
+
}
|
|
13
|
+
return config;
|
|
14
|
+
});
|
|
15
|
+
export default {
|
|
17
16
|
onLaunch: async function () {
|
|
18
|
-
|
|
19
|
-
const gg = await mobile({
|
|
20
|
-
appCode: "GC-MOBILE",
|
|
21
|
-
apiPrefix: "
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
17
|
+
console.log("set", utils.setNavigationBarTitle({ title: "新标题" }));
|
|
18
|
+
const gg = await mobile({
|
|
19
|
+
appCode: "GC-MOBILE",
|
|
20
|
+
apiPrefix: "dev",
|
|
21
|
+
manual:true,
|
|
22
|
+
gc_rsa: {
|
|
23
|
+
appkey: "36994808",
|
|
24
|
+
appsecret: "C075B40D14FE11EBB839BD250AF9C3C0"
|
|
25
|
+
// exclude(request){
|
|
26
|
+
// console.log("request",request)
|
|
27
|
+
// return request.url.indexOf("/apiList") == -1
|
|
28
|
+
// }
|
|
29
|
+
}
|
|
30
30
|
});
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
console.log("App
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
31
|
+
console.log("gg", gg);
|
|
32
|
+
http
|
|
33
|
+
.get("http://192.168.0.38:3000/mock/106/api/table")
|
|
34
|
+
.then((res) => {
|
|
35
|
+
console.log("返回数据", res);
|
|
36
|
+
})
|
|
37
|
+
.catch((err) => {
|
|
38
|
+
console.log("错误数据", err);
|
|
39
|
+
});
|
|
40
|
+
http
|
|
41
|
+
.get("http://192.168.0.38:3000/mock/106/api/test")
|
|
42
|
+
.then((res) => {
|
|
43
|
+
console.log("返回数据", res);
|
|
44
|
+
})
|
|
45
|
+
.catch((err) => {
|
|
46
|
+
console.log("错误数据", err);
|
|
47
|
+
});
|
|
48
|
+
console.log("gg", gg.userInfo);
|
|
49
|
+
this.$store.commit("setUserInfo", gg.userInfo);
|
|
50
|
+
console.log("App Launch");
|
|
51
|
+
},
|
|
52
|
+
onShow: function () {
|
|
53
|
+
console.log("App Show");
|
|
54
|
+
},
|
|
55
|
+
onHide: function () {
|
|
56
|
+
console.log("App Hide");
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
</script>
|
|
60
|
+
|
|
61
|
+
<style>
|
|
62
|
+
/*每个页面公共css */
|
|
63
|
+
</style>
|
|
@@ -1,57 +1,78 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
<view class="content">
|
|
3
|
+
<view class="token">userInfo:{{ userInfo }}</view>
|
|
4
|
+
<view class="token">token:{{ userInfo && userInfo.ucToken }}</view>
|
|
5
|
+
<view
|
|
6
|
+
class="token"
|
|
7
|
+
@click="bind"
|
|
8
|
+
>绑定</view
|
|
9
|
+
>
|
|
10
|
+
<view
|
|
11
|
+
class="token"
|
|
12
|
+
@click="unBind"
|
|
13
|
+
>解绑</view
|
|
14
|
+
>
|
|
15
|
+
</view>
|
|
6
16
|
</template>
|
|
7
17
|
|
|
8
18
|
<script>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
export default {
|
|
20
|
+
data() {
|
|
21
|
+
return {
|
|
22
|
+
title: "Hello"
|
|
23
|
+
};
|
|
24
|
+
},
|
|
25
|
+
computed: {
|
|
26
|
+
userInfo() {
|
|
27
|
+
return this.$store.state.userInfo;
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
onLoad() {},
|
|
31
|
+
methods: {
|
|
32
|
+
async unBind() {
|
|
33
|
+
const res = await this.userInfo.unBind();
|
|
34
|
+
console.log("res",res)
|
|
35
|
+
if(res){
|
|
36
|
+
location.reload()
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
async bind() {
|
|
40
|
+
this.userInfo.bind();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
};
|
|
23
44
|
</script>
|
|
24
45
|
|
|
25
46
|
<style>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
47
|
+
.content {
|
|
48
|
+
display: flex;
|
|
49
|
+
flex-direction: column;
|
|
50
|
+
align-items: center;
|
|
51
|
+
justify-content: center;
|
|
52
|
+
}
|
|
32
53
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
54
|
+
.logo {
|
|
55
|
+
height: 200rpx;
|
|
56
|
+
width: 200rpx;
|
|
57
|
+
margin-top: 200rpx;
|
|
58
|
+
margin-left: auto;
|
|
59
|
+
margin-right: auto;
|
|
60
|
+
margin-bottom: 50rpx;
|
|
61
|
+
}
|
|
41
62
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
63
|
+
.text-area {
|
|
64
|
+
display: flex;
|
|
65
|
+
justify-content: center;
|
|
66
|
+
}
|
|
46
67
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
68
|
+
.title {
|
|
69
|
+
font-size: 36rpx;
|
|
70
|
+
color: #8f8f94;
|
|
71
|
+
}
|
|
51
72
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
</style>
|
|
73
|
+
.token {
|
|
74
|
+
width: 80%;
|
|
75
|
+
margin-left: 10%;
|
|
76
|
+
margin-top: 20px;
|
|
77
|
+
}
|
|
78
|
+
</style>
|