建立小程序前端
建立雲應用後端服務java
構建環境linux
說明:此處選擇 小程序雲應用入門(Mysql版),當前測試環境該方案免費提供,但若連續 7 日未部署過代碼,環境會被自動回收。
- 在 確認訂單 頁面,點擊 確認購買。 購買成功後會自動進入 構建環境 頁面。構建過程會耗時幾分鐘,構建成功後,您能夠選擇 查看應用詳情 ,或者 返回應用列表 。
中文亂碼解決方法git
package com.example.demo; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @RestController public class HelloController { @RequestMapping("/index") public IndexVO hello() { return new IndexVO("this is my first ali small routine!"); } }
開始部署後,雲應用管理 視窗會打出部署日誌。部署結束後會有消息提示部署完成。github
編輯page/index/index.axmlweb
<view> {{index}} <button onTap="index"> 首頁 </button> </view>
編輯page/index/index.jsspring
Page({ data: { index: 'index' }, onLoad(query) { // 頁面加載 console.info(`Page onLoad with query: ${JSON.stringify(query)}`); }, onReady() { // 頁面加載完成 }, onShow() { // 頁面顯示 }, onHide() { // 頁面隱藏 }, onUnload() { // 頁面被關閉 }, onTitleClick() { // 標題被點擊 }, onPullDownRefresh() { // 頁面被下拉 }, onReachBottom() { // 頁面被拉到底部 }, onShareAppMessage() { // 返回自定義分享信息 return { title: 'ali small routine', desc: 'this is my first ali small routine', path: 'pages/index/index', }; }, index() { my.httpRequest({ url: 'https://app2120230256test.mapp-test.xyz/index', // 此處app2120230256test.mapp-test.xyz應修改成SpringBootDemo雲應用所在的雲服務器域名(雲服務(公測) > 環境資源 > 雲服務器ECS > 域名> 二級域名) complete: (res) => { this.setData({ hello: res.data }); }, }); } });
調試sql
至此,支付寶小程序的搭建流程已完成,感謝各位大神的觀看、評價、校訂。PS:下一篇將實現受權登陸功能!小程序
成東 後端
廣州蘆葦科技Java開發團隊
蘆葦科技-廣州專業互聯網軟件服務公司
抓住每一處細節 ,創造每個美好
關注咱們的公衆號,瞭解更多
想和咱們一塊兒奮鬥嗎?lagou搜索「 蘆葦科技 」或者投放簡歷到 server@talkmoney.cn 加入咱們吧
關注咱們,你的評論和點贊對咱們最大的支持