123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- <script>
- export default {
- onLaunch: function() {
- this.createUser();
- },
- onShow: function() {
- console.log('App Show')
- },
- onHide: function() {
- console.log('App Hide')
- },
- methods: {
- //查询用户信息
- createUser() {
- let _this = this;
- // #ifdef H5
- this.$request
- .get({
- url: 'system/temporaryUser',
- loadingTip: "加载中..."
- })
- .then((res) => {
- uni.setStorageSync("user", res.data.user);
- uni.setStorageSync("token", res.data.token);
- });
- // #endif
- // #ifdef MP-TOUTIAO
- tt.login({
- success(res) {
- let para = {
- code: res.code,
- petName: '',
- modelPhone: '',
- };
- _this.$request
- .post({
- url: 'api/douyin/code2Session',
- data: para
- })
- .then(
- (res) => {
- console.log(res);
- uni.setStorageSync("user", res.data.user);
- uni.setStorageSync("token", res.data.token);
- uni.setStorageSync("openId", res.data.openId);
- },
- (err) => {
- console.log("登录失败", err);
- }
- );
- },
- })
- // #endif
- }
- }
- }
- </script>
- <style>
- /*每个页面公共css */
- @font-face {
- font-family: 'Alibaba PuHuiTi 2.0';
- src: url('https://test.jue-ming.com:8849/api/show?filePath=./webo/font/AlibabaPuHuiTi-2-55-Regular/AlibabaPuHuiTi-2-55-Regular.woff2') format('woff2'),
- url('https://test.jue-ming.com:8849/api/show?filePath=./webo/font/AlibabaPuHuiTi-2-55-Regular/AlibabaPuHuiTi-2-55-Regular.woff') format('woff'),
- url('https://test.jue-ming.com:8849/api/show?filePath=./webo/font/AlibabaPuHuiTi-2-55-Regular/AlibabaPuHuiTi-2-55-Regular.ttf') format('truetype');
- font-weight: normal;
- font-style: normal;
- font-display: swap;
- }
- @font-face {
- font-family: 'ZhankuKuaiLeTi';
- src: url('https://test.jue-ming.com:8849/api/show?filePath=./webo/font/ZhankuKuaiLeTi.ttf') format('truetype');
- font-weight: normal;
- font-style: normal;
- font-display: swap;
- }
- @font-face {
- font-family: 'YanShiXieHeiTi';
- src: url('https://test.jue-ming.com:8849/api/show?filePath=./webo/font/演示斜黑体.otf') format('truetype');
- font-weight: normal;
- font-style: normal;
- font-display: swap;
- }
- </style>
|